src/video/x11/SDL_x11window.c
changeset 6369 a92fbd27127b
parent 6343 e94f912d20b9
child 6370 93187f7f7d5d
     1.1 --- a/src/video/x11/SDL_x11window.c	Wed Jul 18 15:01:41 2012 -0700
     1.2 +++ b/src/video/x11/SDL_x11window.c	Wed Jul 18 15:02:48 2012 -0700
     1.3 @@ -269,24 +269,19 @@
     1.4      Atom wmstate_atoms[3];
     1.5      Uint32 fevent = 0;
     1.6  
     1.7 -#if SDL_VIDEO_OPENGL_GLX
     1.8 +#if SDL_VIDEO_OPENGL_GLX || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
     1.9      if (window->flags & SDL_WINDOW_OPENGL) {
    1.10          XVisualInfo *vinfo;
    1.11  
    1.12 -        vinfo = X11_GL_GetVisual(_this, display, screen);
    1.13 -        if (!vinfo) {
    1.14 -            return -1;
    1.15 +#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
    1.16 +        if (data->gles) {
    1.17 +            vinfo = X11_GLES_GetVisual(_this, display, screen);
    1.18 +        } else
    1.19 +#endif
    1.20 +        {
    1.21 +            vinfo = X11_GL_GetVisual(_this, display, screen);
    1.22          }
    1.23 -        visual = vinfo->visual;
    1.24 -        depth = vinfo->depth;
    1.25 -        XFree(vinfo);
    1.26 -    } else
    1.27 -#endif
    1.28 -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
    1.29 -    if (window->flags & SDL_WINDOW_OPENGL) {
    1.30 -        XVisualInfo *vinfo;
    1.31  
    1.32 -        vinfo = X11_GLES_GetVisual(_this, display, screen);
    1.33          if (!vinfo) {
    1.34              return -1;
    1.35          }
    1.36 @@ -395,7 +390,7 @@
    1.37          return -1;
    1.38      }
    1.39  #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
    1.40 -    if (window->flags & SDL_WINDOW_OPENGL) {
    1.41 +    if (data->gles && window->flags & SDL_WINDOW_OPENGL) {
    1.42          /* Create the GLES window surface */
    1.43          _this->gles_data->egl_surface =
    1.44              _this->gles_data->eglCreateWindowSurface(_this->gles_data->