Don't crash if loading the OpenGL library fails
This commit is contained in:
parent
fc98164d8d
commit
db5b89f13f
1 changed files with 3 additions and 1 deletions
|
@ -1305,7 +1305,9 @@ SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
|
||||||
|
|
||||||
if ((window->flags & SDL_WINDOW_OPENGL) != (flags & SDL_WINDOW_OPENGL)) {
|
if ((window->flags & SDL_WINDOW_OPENGL) != (flags & SDL_WINDOW_OPENGL)) {
|
||||||
if (flags & SDL_WINDOW_OPENGL) {
|
if (flags & SDL_WINDOW_OPENGL) {
|
||||||
SDL_GL_LoadLibrary(NULL);
|
if (SDL_GL_LoadLibrary(NULL) < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SDL_GL_UnloadLibrary();
|
SDL_GL_UnloadLibrary();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue