Don't crash if loading the OpenGL library fails

This commit is contained in:
Sam Lantinga 2012-12-28 14:46:03 -08:00
parent b71c7f092b
commit c8ff4f5a46

View File

@ -1305,7 +1305,9 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
if ((window->flags & SDL_WINDOW_OPENGL) != (flags & SDL_WINDOW_OPENGL)) {
if (flags & SDL_WINDOW_OPENGL) {
SDL_GL_LoadLibrary(NULL);
if (SDL_GL_LoadLibrary(NULL) < 0) {
return -1;
}
} else {
SDL_GL_UnloadLibrary();
}