src/video/x11/SDL_x11window.c
changeset 6369 a92fbd27127b
parent 6343 e94f912d20b9
child 6370 93187f7f7d5d
equal deleted inserted replaced
6368:fcbbd0e2da5e 6369:a92fbd27127b
   267     Atom _NET_WM_PID;
   267     Atom _NET_WM_PID;
   268     int wmstate_count;
   268     int wmstate_count;
   269     Atom wmstate_atoms[3];
   269     Atom wmstate_atoms[3];
   270     Uint32 fevent = 0;
   270     Uint32 fevent = 0;
   271 
   271 
   272 #if SDL_VIDEO_OPENGL_GLX
   272 #if SDL_VIDEO_OPENGL_GLX || SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
   273     if (window->flags & SDL_WINDOW_OPENGL) {
   273     if (window->flags & SDL_WINDOW_OPENGL) {
   274         XVisualInfo *vinfo;
   274         XVisualInfo *vinfo;
   275 
   275 
   276         vinfo = X11_GL_GetVisual(_this, display, screen);
   276 #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
   277         if (!vinfo) {
   277         if (data->gles) {
   278             return -1;
   278             vinfo = X11_GLES_GetVisual(_this, display, screen);
   279         }
   279         } else
   280         visual = vinfo->visual;
       
   281         depth = vinfo->depth;
       
   282         XFree(vinfo);
       
   283     } else
       
   284 #endif
   280 #endif
   285 #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
   281         {
   286     if (window->flags & SDL_WINDOW_OPENGL) {
   282             vinfo = X11_GL_GetVisual(_this, display, screen);
   287         XVisualInfo *vinfo;
   283         }
   288 
   284 
   289         vinfo = X11_GLES_GetVisual(_this, display, screen);
       
   290         if (!vinfo) {
   285         if (!vinfo) {
   291             return -1;
   286             return -1;
   292         }
   287         }
   293         visual = vinfo->visual;
   288         visual = vinfo->visual;
   294         depth = vinfo->depth;
   289         depth = vinfo->depth;
   393     if (!w) {
   388     if (!w) {
   394         SDL_SetError("Couldn't create window");
   389         SDL_SetError("Couldn't create window");
   395         return -1;
   390         return -1;
   396     }
   391     }
   397 #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
   392 #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
   398     if (window->flags & SDL_WINDOW_OPENGL) {
   393     if (data->gles && window->flags & SDL_WINDOW_OPENGL) {
   399         /* Create the GLES window surface */
   394         /* Create the GLES window surface */
   400         _this->gles_data->egl_surface =
   395         _this->gles_data->egl_surface =
   401             _this->gles_data->eglCreateWindowSurface(_this->gles_data->
   396             _this->gles_data->eglCreateWindowSurface(_this->gles_data->
   402                                                  egl_display,
   397                                                  egl_display,
   403                                                  _this->gles_data->egl_config,
   398                                                  _this->gles_data->egl_config,