cocoa/gles: do not unload EGL when context is destroyed

(cherry picked from commit e8091b89830c3b9bb19eff76463a6e2525f05fa5)
This commit is contained in:
Sam Lantinga 2023-02-20 10:40:54 -08:00
parent eb22fbc894
commit 0efb31ef32

View file

@ -49,7 +49,7 @@ Cocoa_GLES_LoadLibrary(_THIS, const char *path)
return SDL_SetError("SDL not configured with OpenGL/CGL support"); return SDL_SetError("SDL not configured with OpenGL/CGL support");
#endif #endif
} }
if (_this->egl_data == NULL) { if (_this->egl_data == NULL) {
return SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0); return SDL_EGL_LoadLibrary(_this, NULL, EGL_DEFAULT_DISPLAY, 0);
} }
@ -95,7 +95,6 @@ Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context)
{ @autoreleasepool { @autoreleasepool
{ {
SDL_EGL_DeleteContext(_this, context); SDL_EGL_DeleteContext(_this, context);
Cocoa_GLES_UnloadLibrary(_this);
}} }}
int int
@ -133,7 +132,7 @@ Cocoa_GLES_SetupWindow(_THIS, SDL_Window * window)
} }
_this->gl_config.driver_loaded = 1; _this->gl_config.driver_loaded = 1;
} }
/* Create the GLES window surface */ /* Create the GLES window surface */
v = windowdata.nswindow.contentView; v = windowdata.nswindow.contentView;
windowdata.egl_surface = SDL_EGL_CreateSurface(_this, (__bridge NativeWindowType)[v layer]); windowdata.egl_surface = SDL_EGL_CreateSurface(_this, (__bridge NativeWindowType)[v layer]);