From 60fb545fecf18f8230b402b2fa7cd4789d15ab14 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 28 Oct 2012 14:16:18 -0700 Subject: [PATCH] Don't try to create an OpenGL window if we can't load the OpenGL library. --- src/video/SDL_video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index aa6362070..254de9eec 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1168,7 +1168,9 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags) 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;