I did many of his tutorials and now I have a problem that didn't exist before.
I load img1 but the line SDL_DisplayFormat(img1) DOES NOTHING ( found this out during debug) and so the program exits.What am I doing wrong?
Here is the snippet:
SDL_Surface* loadimg(std::string filename){ SDL_Surface* img1 = NULL; SDL_Surface* img2 =NULL; img1 = IMG_Load(filename.c_str()); if(img1 !=NULL) { img2 = SDL_DisplayFormat(img1); SDL_FreeSurface(img1); if(img2 != NULL) SDL_SetColorKey(img2,SDL_SRCCOLORKEY,SDL_MapRGB(img2->format,0xFF,0xFF,0xFF)); } return img1;}
Thanks in advance.