- EGLint pi32ConfigAttribs[5];\r
- pi32ConfigAttribs[0] = EGL_SURFACE_TYPE;\r
- pi32ConfigAttribs[1] = EGL_WINDOW_BIT;\r
- pi32ConfigAttribs[2] = EGL_RENDERABLE_TYPE;\r
- pi32ConfigAttribs[3] = EGL_OPENGL_ES2_BIT; \r
- pi32ConfigAttribs[4] = EGL_NONE;\r
-\r
- EGLint pi32ContextAttribs[3];\r
- pi32ContextAttribs[0] = EGL_CONTEXT_CLIENT_VERSION;\r
- pi32ContextAttribs[1] = 2;\r
- pi32ContextAttribs[2] = EGL_NONE;\r
-\r
- int iConfigs;\r
- if (!eglChooseConfig(display, attributeList, &eglConfig, 1, &iConfigs) || (iConfigs != 1))\r
+ // Creates the X11 window\r
+ x11Window = XCreateWindow( x11Display, RootWindow(x11Display, x11Screen), 0, 0, iResX, iResY,\r
+ 0, CopyFromParent, InputOutput, CopyFromParent, ui32Mask, &sWA);\r
+\r
+ // Make the window viewable and flush the output buffer.\r
+ XMapWindow(x11Display, x11Window);\r
+ XFlush(x11Display);\r
+\r
+ // Make the window fullscreen\r
+ unsigned char fullScreen = 1;\r
+ Atom wmState = XInternAtom(x11Display, "_NET_WM_STATE", False);\r
+ Atom wmFullScreen = XInternAtom(x11Display,"_NET_WM_STATE_FULLSCREEN", False);\r
+\r
+ XEvent xev;\r
+ xev.xclient.type = ClientMessage;\r
+ xev.xclient.serial = 0;\r
+ xev.xclient.send_event = True;\r
+ xev.xclient.window = x11Window;\r
+ xev.xclient.message_type = wmState;\r
+ xev.xclient.format = 32;\r
+ xev.xclient.data.l[0] = (fullScreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE);\r
+ xev.xclient.data.l[1] = wmFullScreen;\r
+ xev.xclient.data.l[2] = 0;\r
+\r
+ XSendEvent(x11Display, DefaultRootWindow(x11Display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);\r
+\r
+ display = eglGetDisplay( (EGLNativeDisplayType)x11Display );\r
+ break;\r
+#endif\r
+ case MODE_RAW:\r
+ default:\r
+ display = eglGetDisplay( (EGLNativeDisplayType)0 );\r
+ break;\r
+ }\r
+\r
+ if( display == EGL_NO_DISPLAY )\r