Help with SDL? No entry point?

Ill probably go find help in the SDL forums but anyways it says there is no entry point? I'm new with SDL so it will probably be something REALLY simple...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//Andrew Wilson ^.^
//Game

#include<iostream>
#include<iomanip>
#include<conio.h>
#include<string>
#include<SDL.h>
#include<SDL_image.h>
using namespace std;

SDL_Surface *Kenferd_Taunt;
string Filename;
SDL_Window *Window;

int main()
{
	//Setting the filename to be loaded
	Filename = "Kenferd The III(Taunt).png";

	//Initializing
	if(SDL_Init(SDL_INIT_VIDEO) != 0)
	{
		printf("Unable to initialize SDL: %s\n", SDL_GetError());
		return 1;
	}
	
	//Set the actual window with parameters
	Window = SDL_CreateWindow("Andrews",200,200,500,500, SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL);
	if(Window == NULL)
	{
		cout<<"Could not create window: "<< SDL_GetError() << '\n';
		return 1;
	}

	//Loading the image
	Kenferd_Taunt = IMG_Load(Filename.c_str());
	//Kenferd_Taunt = SDL_DisplayFormat(KenferdTaunt); //Whats wrong with this line?
	if(Kenferd_Taunt == NULL)
	{
		cout<<"ERROR: Could not load image "<<Filename<<endl;
		exit(1);
	}

	getch();
	
	//Get rid of window
	SDL_DestroyWindow(Window);

	//Clean up window
	SDL_Quit();
	return 0;
}
Last edited on
Topic archived. No new replies allowed.