src/video/x11/SDL_x11window.c
changeset 3161 494559cc723b
parent 3078 81d15ace9129
child 3225 5859d0a0c519
     1.1 --- a/src/video/x11/SDL_x11window.c	Thu May 28 09:39:14 2009 +0000
     1.2 +++ b/src/video/x11/SDL_x11window.c	Sun May 31 11:53:12 2009 +0000
     1.3 @@ -31,6 +31,10 @@
     1.4  #include "SDL_x11gamma.h"
     1.5  #include "../Xext/extensions/StdCmap.h"
     1.6  
     1.7 +#ifdef SDL_VIDEO_DRIVER_PANDORA
     1.8 +#include "SDL_x11opengles.h"
     1.9 +#endif
    1.10 +
    1.11  #define _NET_WM_STATE_REMOVE    0l
    1.12  #define _NET_WM_STATE_ADD       1l
    1.13  #define _NET_WM_STATE_TOGGLE    2l
    1.14 @@ -241,6 +245,19 @@
    1.15          XFree(vinfo);
    1.16      } else
    1.17  #endif
    1.18 +#ifdef SDL_VIDEO_DRIVER_PANDORA
    1.19 +    if (window->flags & SDL_WINDOW_OPENGL) {
    1.20 +        XVisualInfo *vinfo;
    1.21 +
    1.22 +        vinfo = X11_GLES_GetVisual(_this, data->display, displaydata->screen);
    1.23 +        if (!vinfo) {
    1.24 +            return -1;
    1.25 +        }
    1.26 +        visual = vinfo->visual;
    1.27 +        depth = vinfo->depth;
    1.28 +        XFree(vinfo);
    1.29 +    } else
    1.30 +#endif
    1.31      {
    1.32          visual = displaydata->visual;
    1.33          depth = displaydata->depth;
    1.34 @@ -505,6 +522,19 @@
    1.35          SDL_SetError("Couldn't create window");
    1.36          return -1;
    1.37      }
    1.38 +#if SDL_VIDEO_DRIVER_PANDORA
    1.39 +    /* Create the GLES window surface */
    1.40 +    _this->gles_data->egl_surface =
    1.41 +        _this->gles_data->eglCreateWindowSurface(_this->gles_data->
    1.42 +                                                 egl_display,
    1.43 +                                                 _this->gles_data->egl_config,
    1.44 +                                                 (NativeWindowType) w, NULL);
    1.45 +
    1.46 +    if (_this->gles_data->egl_surface == EGL_NO_SURFACE) {
    1.47 +        SDL_SetError("Could not create GLES window surface");
    1.48 +        return -1;
    1.49 +    }
    1.50 +#endif
    1.51  
    1.52      sizehints = XAllocSizeHints();
    1.53      if (sizehints) {