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 fc98164d8d
commit db5b89f13f

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();
}