Don't try to create an OpenGL window if we can't load the OpenGL library.
authorSam Lantinga <slouken@libsdl.org>
Sun, 28 Oct 2012 14:16:18 -0700
changeset 6611 5c8b5b03ad8a
parent 6610 4032f8efdfe7
child 6612 9a22ac8befa9
Don't try to create an OpenGL window if we can't load the OpenGL library.
src/video/SDL_video.c
--- a/src/video/SDL_video.c	Sun Oct 28 13:03:45 2012 -0700
+++ b/src/video/SDL_video.c	Sun Oct 28 14:16:18 2012 -0700
@@ -1168,7 +1168,9 @@
             SDL_SetError("No OpenGL support in video driver");
             return NULL;
         }
-        SDL_GL_LoadLibrary(NULL);
+        if (SDL_GL_LoadLibrary(NULL) < 0) {
+            return NULL;
+        }
     }
     window = (SDL_Window *)SDL_calloc(1, sizeof(*window));
     window->magic = &_this->window_magic;