mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
Clean up X11 OpenGL ES backend
If you really need to switch between OpenGL and GLES context types, just issue a SDL_GL_UnloadLibrary manually.
This commit is contained in:
parent
2f30140418
commit
9095952ac4
@ -36,6 +36,7 @@ X11_GLES_LoadLibrary(_THIS, const char *path) {
|
|||||||
/* If the profile requested is not GL ES, switch over to X11_GL functions */
|
/* If the profile requested is not GL ES, switch over to X11_GL functions */
|
||||||
if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) {
|
if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) {
|
||||||
#if SDL_VIDEO_OPENGL_GLX
|
#if SDL_VIDEO_OPENGL_GLX
|
||||||
|
X11_GLES_UnloadLibrary(_this);
|
||||||
_this->GL_LoadLibrary = X11_GL_LoadLibrary;
|
_this->GL_LoadLibrary = X11_GL_LoadLibrary;
|
||||||
_this->GL_GetProcAddress = X11_GL_GetProcAddress;
|
_this->GL_GetProcAddress = X11_GL_GetProcAddress;
|
||||||
_this->GL_UnloadLibrary = X11_GL_UnloadLibrary;
|
_this->GL_UnloadLibrary = X11_GL_UnloadLibrary;
|
||||||
@ -100,19 +101,6 @@ X11_GLES_CreateContext(_THIS, SDL_Window * window)
|
|||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
X11_GLES_DeleteContext(_THIS, SDL_GLContext context)
|
|
||||||
{
|
|
||||||
/* FIXME: This "crappy fix" comes from the previous GLES X11 code,
|
|
||||||
* it's required so you can create a GLX context, destroy it and create a EGL one
|
|
||||||
* To be able to fix this, we need to add a function SDL_GL_ResetContext and
|
|
||||||
* disallow SDL_GL_MakeCurrent from taking a NULL pointer, thus ensuring we can
|
|
||||||
* determine if it is a GLX or EGL context
|
|
||||||
*/
|
|
||||||
SDL_EGL_DeleteContext(_this, context);
|
|
||||||
X11_GLES_UnloadLibrary(_this);
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_EGL_SwapWindow_impl(X11)
|
SDL_EGL_SwapWindow_impl(X11)
|
||||||
SDL_EGL_MakeCurrent_impl(X11)
|
SDL_EGL_MakeCurrent_impl(X11)
|
||||||
|
|
||||||
|
@ -38,13 +38,13 @@ typedef struct SDL_PrivateGLESData
|
|||||||
#define X11_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
|
#define X11_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
|
||||||
#define X11_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
|
#define X11_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
|
||||||
#define X11_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
|
#define X11_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
|
||||||
|
#define X11_GLES_DeleteContext SDL_EGL_DeleteContext
|
||||||
|
|
||||||
extern int X11_GLES_LoadLibrary(_THIS, const char *path);
|
extern int X11_GLES_LoadLibrary(_THIS, const char *path);
|
||||||
extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen);
|
extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen);
|
||||||
extern SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window * window);
|
extern SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window * window);
|
||||||
extern void X11_GLES_SwapWindow(_THIS, SDL_Window * window);
|
extern void X11_GLES_SwapWindow(_THIS, SDL_Window * window);
|
||||||
extern int X11_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
|
extern int X11_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
|
||||||
extern void X11_GLES_DeleteContext(_THIS, SDL_GLContext context);
|
|
||||||
|
|
||||||
#endif /* SDL_VIDEO_OPENGL_EGL */
|
#endif /* SDL_VIDEO_OPENGL_EGL */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user