开发者

SDL_DisplayFormat

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜