prefs item "sdlrender"

This commit is contained in:
kanjitalk755 2020-05-18 17:39:05 +09:00
parent a528b0a40f
commit a01387b1af

View File

@ -763,11 +763,17 @@ static SDL_Surface * init_sdl_video(int width, int height, int bpp, Uint32 flags
} }
if (!sdl_renderer) { if (!sdl_renderer) {
const char *render_driver = PrefsFindString("sdlrender");
if (render_driver) {
SDL_SetHint(SDL_HINT_RENDER_DRIVER, render_driver);
}
else {
#ifdef WIN32 #ifdef WIN32
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software"); SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software");
#else #else
SDL_SetHint(SDL_HINT_RENDER_DRIVER, ""); SDL_SetHint(SDL_HINT_RENDER_DRIVER, "");
#endif #endif
}
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0); sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0);
if (!sdl_renderer) { if (!sdl_renderer) {
shutdown_sdl_video(); shutdown_sdl_video();