More verbosely log SDL failure.

This commit is contained in:
Themaister 2011-12-27 00:37:29 +01:00
parent df4e0bb1e4
commit 70587bc0df

View File

@ -131,21 +131,29 @@ bool sdlwrap_set_video_mode(
#endif #endif
#if SDL_MODERN #if SDL_MODERN
if (bits == 15) if (bits == 15)
{ {
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5); SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
} }
g_window = SDL_CreateWindow("SSNES", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
width, height, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | (fullscreen ? SDL_WINDOW_FULLSCREEN : resizable)); g_window = SDL_CreateWindow("SSNES", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
if (!g_window) width, height, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | (fullscreen ? SDL_WINDOW_FULLSCREEN : resizable));
return false; if (!g_window)
g_ctx = SDL_GL_CreateContext(g_window); {
SSNES_ERR("Failed to create SDL window!\n");
return false;
}
g_ctx = SDL_GL_CreateContext(g_window);
#else #else
if (!SDL_SetVideoMode(width, height, bits, if (!SDL_SetVideoMode(width, height, bits,
SDL_OPENGL | (fullscreen ? SDL_FULLSCREEN : resizable))) SDL_OPENGL | (fullscreen ? SDL_FULLSCREEN : resizable)))
{
SSNES_ERR("Failed to create SDL window!\n");
return false; return false;
}
#endif #endif
int attr = 0; int attr = 0;