comparison src/video/x11/SDL_x11window.c @ 3161:494559cc723b

OpenPandora support added by David Carré
author Sam Lantinga <slouken@libsdl.org>
date Sun, 31 May 2009 11:53:12 +0000
parents 81d15ace9129
children 5859d0a0c519
comparison
equal deleted inserted replaced
3160:210e209b87cc 3161:494559cc723b
28 28
29 #include "SDL_x11video.h" 29 #include "SDL_x11video.h"
30 #include "SDL_x11mouse.h" 30 #include "SDL_x11mouse.h"
31 #include "SDL_x11gamma.h" 31 #include "SDL_x11gamma.h"
32 #include "../Xext/extensions/StdCmap.h" 32 #include "../Xext/extensions/StdCmap.h"
33
34 #ifdef SDL_VIDEO_DRIVER_PANDORA
35 #include "SDL_x11opengles.h"
36 #endif
33 37
34 #define _NET_WM_STATE_REMOVE 0l 38 #define _NET_WM_STATE_REMOVE 0l
35 #define _NET_WM_STATE_ADD 1l 39 #define _NET_WM_STATE_ADD 1l
36 #define _NET_WM_STATE_TOGGLE 2l 40 #define _NET_WM_STATE_TOGGLE 2l
37 41
239 visual = vinfo->visual; 243 visual = vinfo->visual;
240 depth = vinfo->depth; 244 depth = vinfo->depth;
241 XFree(vinfo); 245 XFree(vinfo);
242 } else 246 } else
243 #endif 247 #endif
248 #ifdef SDL_VIDEO_DRIVER_PANDORA
249 if (window->flags & SDL_WINDOW_OPENGL) {
250 XVisualInfo *vinfo;
251
252 vinfo = X11_GLES_GetVisual(_this, data->display, displaydata->screen);
253 if (!vinfo) {
254 return -1;
255 }
256 visual = vinfo->visual;
257 depth = vinfo->depth;
258 XFree(vinfo);
259 } else
260 #endif
244 { 261 {
245 visual = displaydata->visual; 262 visual = displaydata->visual;
246 depth = displaydata->depth; 263 depth = displaydata->depth;
247 } 264 }
248 265
503 CWColormap), &xattr); 520 CWColormap), &xattr);
504 if (!w) { 521 if (!w) {
505 SDL_SetError("Couldn't create window"); 522 SDL_SetError("Couldn't create window");
506 return -1; 523 return -1;
507 } 524 }
525 #if SDL_VIDEO_DRIVER_PANDORA
526 /* Create the GLES window surface */
527 _this->gles_data->egl_surface =
528 _this->gles_data->eglCreateWindowSurface(_this->gles_data->
529 egl_display,
530 _this->gles_data->egl_config,
531 (NativeWindowType) w, NULL);
532
533 if (_this->gles_data->egl_surface == EGL_NO_SURFACE) {
534 SDL_SetError("Could not create GLES window surface");
535 return -1;
536 }
537 #endif
508 538
509 sizehints = XAllocSizeHints(); 539 sizehints = XAllocSizeHints();
510 if (sizehints) { 540 if (sizehints) {
511 if ((window->flags & SDL_WINDOW_RESIZABLE) 541 if ((window->flags & SDL_WINDOW_RESIZABLE)
512 && !(window->flags & SDL_WINDOW_FULLSCREEN)) { 542 && !(window->flags & SDL_WINDOW_FULLSCREEN)) {