开发者

SDL_DisplayFormat

开发者 https://www.devze.com 2023-03-01 22:16 出处:网络
why is this simple code not working? its so weird. string f = \"pic.bmp\"; SDL_Surface * loaded = NULL;

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

精彩评论

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