【发布时间】:2014-03-26 19:20:59
【问题描述】:
我在尝试将 SDL_FillRect 与 SDL 2.0 一起使用时遇到问题
这是我的代码:
bool running = true;
//Initialise SDL
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Window *screen = SDL_CreateWindow("Test Game",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
640, 480,
SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_OPENGL);
while (running){
SDL_FillRect(screen, NULL, 0);
}
//Quit SDL
SDL_Quit();
return 0;
我得到的错误是:
1>c:\users\ethan\desktop\c++ projects\another test with sdl\another 使用 sdl\main.cpp(16) 进行测试:错误 C2664:'int SDL_FillRect(SDL_Surface *,const SDL_Rect *,Uint32)' : 无法将参数 1 从 'SDL_Window *' 转换为 'SDL_Surface *'
1> 指向的类型是 无关;转换需要 reinterpret_cast、C-style cast 或 函数式转换
【问题讨论】: