Fixed crash if the rendering system couldn't create an OpenGL window.

This commit is contained in:
Sam Lantinga 2012-01-07 21:01:33 -08:00
parent 5b2a5e3412
commit 6261562fa0

View file

@ -239,6 +239,8 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
window_flags = SDL_GetWindowFlags(window);
if (!(window_flags & SDL_WINDOW_OPENGL)) {
if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
/* Uh oh, better try to put it back... */
SDL_RecreateWindow(window, window_flags);
return NULL;
}
}