why is this simple code not working? its so weird.
string f = "pic.bmp";
SDL_Surface * loaded = NULL;
SDL_Surface * optimized = NULL;
loaded = SDL_LoadBMP(f.c_str());
if (loaded != NULL){
optimized = SDL_DisplayFormat(loaded); // errors here
the file compiles开发者_JAVA百科, but will not run past there
I guess I should make this an answer.
You need to call SDL_Init() first or SDL_DisplayFormat() will not work.
See the docs.
精彩评论