Clean up X11 OpenGL ES backend
authorGabriel Jacobo <gabomdq@gmail.com>
Wed, 20 Nov 2013 12:51:18 -0300
changeset 8018cff03048babd
parent 8017 d84a30e5cbd5
child 8019 5d85b2186aae
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.
src/video/x11/SDL_x11opengles.c
src/video/x11/SDL_x11opengles.h
     1.1 --- a/src/video/x11/SDL_x11opengles.c	Tue Nov 19 15:25:00 2013 -0500
     1.2 +++ b/src/video/x11/SDL_x11opengles.c	Wed Nov 20 12:51:18 2013 -0300
     1.3 @@ -36,6 +36,7 @@
     1.4      /* If the profile requested is not GL ES, switch over to X11_GL functions  */
     1.5      if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) {
     1.6          #if SDL_VIDEO_OPENGL_GLX
     1.7 +        X11_GLES_UnloadLibrary(_this);
     1.8          _this->GL_LoadLibrary = X11_GL_LoadLibrary;
     1.9          _this->GL_GetProcAddress = X11_GL_GetProcAddress;
    1.10          _this->GL_UnloadLibrary = X11_GL_UnloadLibrary;
    1.11 @@ -100,19 +101,6 @@
    1.12      return context;
    1.13  }
    1.14  
    1.15 -void
    1.16 -X11_GLES_DeleteContext(_THIS, SDL_GLContext context)
    1.17 -{
    1.18 -    /* FIXME: This "crappy fix" comes from the previous GLES X11 code, 
    1.19 -     * it's required so you can create a GLX context, destroy it and create a EGL one 
    1.20 -     * To be able to fix this, we need to add a function SDL_GL_ResetContext and
    1.21 -     * disallow SDL_GL_MakeCurrent from taking a NULL pointer, thus ensuring we can
    1.22 -     * determine if it is a GLX or EGL context
    1.23 -     */
    1.24 -    SDL_EGL_DeleteContext(_this, context);
    1.25 -    X11_GLES_UnloadLibrary(_this);
    1.26 -}
    1.27 -
    1.28  SDL_EGL_SwapWindow_impl(X11)
    1.29  SDL_EGL_MakeCurrent_impl(X11)
    1.30  
     2.1 --- a/src/video/x11/SDL_x11opengles.h	Tue Nov 19 15:25:00 2013 -0500
     2.2 +++ b/src/video/x11/SDL_x11opengles.h	Wed Nov 20 12:51:18 2013 -0300
     2.3 @@ -38,13 +38,13 @@
     2.4  #define X11_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
     2.5  #define X11_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
     2.6  #define X11_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
     2.7 +#define X11_GLES_DeleteContext SDL_EGL_DeleteContext
     2.8  
     2.9  extern int X11_GLES_LoadLibrary(_THIS, const char *path);
    2.10  extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen);
    2.11  extern SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window * window);
    2.12  extern void X11_GLES_SwapWindow(_THIS, SDL_Window * window);
    2.13  extern int X11_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
    2.14 -extern void X11_GLES_DeleteContext(_THIS, SDL_GLContext context);
    2.15  
    2.16  #endif /* SDL_VIDEO_OPENGL_EGL */
    2.17