From 4dee5652eea97322843d97a47a664ac1e4fbd940 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Fri, 21 Aug 2015 02:07:03 +0200 Subject: [PATCH] x11: Allow starting in fullscreen via config --- core/linux-dist/x11.cpp | 54 +++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/core/linux-dist/x11.cpp b/core/linux-dist/x11.cpp index df0c5818d..01a4fdbe1 100644 --- a/core/linux-dist/x11.cpp +++ b/core/linux-dist/x11.cpp @@ -244,9 +244,11 @@ void x11_window_create() #ifdef TARGET_PANDORA x11_width = 800; x11_height = 480; + x11_fullscreen = true; #else x11_width = cfgLoadInt("x11", "width", WINDOW_WIDTH); x11_height = cfgLoadInt("x11", "height", WINDOW_HEIGHT); + x11_fullscreen = (cfgLoadInt("x11", "fullscreen", 0) > 0); #endif if (x11_width < 0 || x11_height < 0) @@ -272,34 +274,34 @@ void x11_window_create() else { XMapWindow(x11Display, x11Window); - - #if !defined(GLES) - #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 - #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 - typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*); - - glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0; - glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)glXGetProcAddressARB((const GLubyte*)"glXCreateContextAttribsARB"); - verify(glXCreateContextAttribsARB != 0); - int context_attribs[] = - { - GLX_CONTEXT_MAJOR_VERSION_ARB, 3, - GLX_CONTEXT_MINOR_VERSION_ARB, 1, - GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB, - GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, - None - }; - - x11_glc = glXCreateContextAttribsARB(x11Display, bestFbc, 0, True, context_attribs); - XSync(x11Display, False); - - if (!x11_glc) - { - die("Failed to create GL3.1 context\n"); - } - #endif } + #if !defined(GLES) + #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 + #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 + typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*); + + glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0; + glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)glXGetProcAddressARB((const GLubyte*)"glXCreateContextAttribsARB"); + verify(glXCreateContextAttribsARB != 0); + int context_attribs[] = + { + GLX_CONTEXT_MAJOR_VERSION_ARB, 3, + GLX_CONTEXT_MINOR_VERSION_ARB, 1, + GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB, + GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, + None + }; + + x11_glc = glXCreateContextAttribsARB(x11Display, bestFbc, 0, True, context_attribs); + XSync(x11Display, False); + + if (!x11_glc) + { + die("Failed to create GL3.1 context\n"); + } + #endif + XFlush(x11Display); //(EGLNativeDisplayType)x11Display;