diff src/video/x11/SDL_x11window.c @ 3057:089a77aebb7d

Added test program for SDL_CreateWindowFrom() Make sure OpenGL library is loaded before working with OpenGL windows, even those created with SDL_CreateWindowFrom()
author Sam Lantinga <slouken@libsdl.org>
date Mon, 09 Feb 2009 05:32:12 +0000
parents b7197d7e8566
children 9b58f26ede81
line wrap: on
line diff
--- a/src/video/x11/SDL_x11window.c	Sun Feb 08 15:35:06 2009 +0000
+++ b/src/video/x11/SDL_x11window.c	Mon Feb 09 05:32:12 2009 +0000
@@ -188,9 +188,6 @@
     if (window->flags & SDL_WINDOW_OPENGL) {
         XVisualInfo *vinfo;
 
-        if (X11_GL_Initialize(_this) < 0) {
-            return -1;
-        }
         vinfo = X11_GL_GetVisual(_this, data->display, displaydata->screen);
         if (!vinfo) {
             return -1;
@@ -461,11 +458,6 @@
                       (CWOverrideRedirect | CWBackPixel | CWBorderPixel |
                        CWColormap), &xattr);
     if (!w) {
-#ifdef SDL_VIDEO_OPENGL_GLX
-        if (window->flags & SDL_WINDOW_OPENGL) {
-            X11_GL_Shutdown(_this);
-        }
-#endif
         SDL_SetError("Couldn't create window");
         return -1;
     }
@@ -622,11 +614,6 @@
     XSetWMProtocols(data->display, w, &data->WM_DELETE_WINDOW, 1);
 
     if (SetupWindowData(_this, window, w, SDL_TRUE) < 0) {
-#ifdef SDL_VIDEO_OPENGL_GLX
-        if (window->flags & SDL_WINDOW_OPENGL) {
-            X11_GL_Shutdown(_this);
-        }
-#endif
         XDestroyWindow(data->display, w);
         return -1;
     }
@@ -942,11 +929,6 @@
                 }
             }
         }
-#ifdef SDL_VIDEO_OPENGL_GLX
-        if (window->flags & SDL_WINDOW_OPENGL) {
-            X11_GL_Shutdown(_this);
-        }
-#endif
 #ifdef X_HAVE_UTF8_STRING
         if (data->ic) {
             XDestroyIC(data->ic);