Hi,
I'm just getting started with using SDL to create graphics. I am using C. But I have come across an error which I simply cannot understand.
My code is supposed to set up SDL and then set a video mode. It does this successfully. However, it will not load a BMP file. I have tried putting the BMP file in the same directory and on the root of the drive in case something silly was happening, neither was successful.
Heres the code:
Code:
#include <SDL/SDL.h>#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
SDL_Surface *screen;
SDL_Surface *image;
SDL_Rect src, dest;
if(SDL_Init(SDL_INIT_VIDEO)!=0){
return 1;
}
atexit(SDL_Quit);
screen=SDL_SetVideoMode(640, 480, 16, SDL_FULLSCREEN);
if(screen == NULL){
return 2;
}
//SDL_Delay(2000);
image=SDL_LoadBMP("image.bmp");
if(image == NULL){
return 3;
}
return 0;
}
It will _always_ return 3. It's like the file somehow does not exist.
Any help would be appreciated,
Thanks!
EDIT: Now this is getting really silly, even if I remove the "return 3" code and delete the EXE and then recompile, it is still returning 3 in the newly built EXE.