从任何关于支持视网膜显示器的 SDL (2.0) 的 Google 搜索中,我都找不到任何有用的东西。谁能指出我正确的方向?
我正在使用这段代码:
//Start SDL
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Window *screen = NULL;
SDL_Renderer *render = NULL;
SDL_Texture *texture = NULL;
SDL_Event e;
bool quit = false;
screen = SDL_CreateWindow("Sample Image",100,100,500,500,SDL_WINDOW_SHOWN);
render = SDL_CreateRenderer(screen,-1,SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
texture = IMG_LoadTexture(render,"image.bmp");
if (texture == NULL)
{
printf("%s",IMG_GetError());
}
//Render all graphics
SDL_RenderClear(render);
SDL_RenderCopy(render,texture,NULL,NULL);
SDL_RenderPresent(render);
while (quit == false) {
while (SDL_PollEvent(&e)) {
if (e.type == SDL_QUIT)
quit = true;
}
}
//Remove all graphics from memory
SDL_DestroyRenderer(render);
SDL_DestroyTexture(texture);
SDL_DestroyWindow(screen);
//Quit SDL
SDL_Quit();