diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 58939053c..3358f47b8 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -438,8 +438,6 @@ SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) LOAD_FUNC_EGLEXT(eglQueryDevicesEXT); LOAD_FUNC_EGLEXT(eglGetPlatformDisplayEXT); - _this->gl_config.driver_loaded = 1; - if (path) { SDL_strlcpy(_this->gl_config.driver_path, path, sizeof(_this->gl_config.driver_path) - 1); } else { diff --git a/src/video/cocoa/SDL_cocoaopengles.m b/src/video/cocoa/SDL_cocoaopengles.m index a45a9f57c..0f551de10 100644 --- a/src/video/cocoa/SDL_cocoaopengles.m +++ b/src/video/cocoa/SDL_cocoaopengles.m @@ -109,10 +109,12 @@ Cocoa_GLES_SetupWindow(_THIS, SDL_Window * window) if (_this->egl_data == NULL) { + SDL_assert(!_this->gl_config.driver_loaded); if (SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0) < 0) { SDL_EGL_UnloadLibrary(_this); return -1; } + _this->gl_config.driver_loaded = 1; } /* Create the GLES window surface */ diff --git a/src/video/windows/SDL_windowsopengles.c b/src/video/windows/SDL_windowsopengles.c index e4bfe49cc..5ee46d83c 100644 --- a/src/video/windows/SDL_windowsopengles.c +++ b/src/video/windows/SDL_windowsopengles.c @@ -107,12 +107,13 @@ WIN_GLES_SetupWindow(_THIS, SDL_Window * window) SDL_Window *current_win = SDL_GL_GetCurrentWindow(); SDL_GLContext current_ctx = SDL_GL_GetCurrentContext(); - if (_this->egl_data == NULL) { + SDL_assert(!_this->gl_config.driver_loaded); if (SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0) < 0) { SDL_EGL_UnloadLibrary(_this); return -1; } + _this->gl_config.driver_loaded = 1; } /* Create the GLES window surface */