sdl loadiing image failing?

earlier today i posted a thread fabout my sdl program. i couldnt seem to load any images, so i made a modification to the code to check if the program couldnt find the image.

this is what i came up with:

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
#include <sdl.h>
#include <Windows.h>

int main( int argc, char* args[] ){
	SDL_Surface* hello = NULL;
	SDL_Surface* screen = NULL;

	SDL_Init ( SDL_INIT_EVERYTHING );
	SDL_WM_SetCaption ("hello world!", NULL);

	screen = SDL_SetVideoMode (648, 480, 32, SDL_SWSURFACE);
	hello = SDL_LoadBMP ("hello.bmp");
	SDL_BlitSurface (hello, NULL, screen, NULL);
	SDL_Flip ( screen );

	if (hello == NULL){
		MessageBox (NULL, "unable to load image", "Error", MB_OK);
	}

	SDL_Event event;
	bool cary_on = true;

	while(cary_on == true){
		while(SDL_PollEvent ( &event )){
			if (event.type == SDL_QUIT){
				cary_on = false;
			}
		}
	}

	SDL_Quit();
	return 0;
}


this makes an error box pop up if the image wasnt found, and as i expected the box appeared. can anyone tell me why the image isnt found? oh and just to be sure i havent simply out the image in the wrong place, where exactly am i supposed to place image files i want to use in my program?
Last edited on
There's no reason to make another thread -- I just answered you in your original thread:

http://cplusplus.com/forum/general/51763/
Topic archived. No new replies allowed.