diff options
Diffstat (limited to 'platform/linuxbsd/context_gl_x11.cpp')
-rw-r--r-- | platform/linuxbsd/context_gl_x11.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/platform/linuxbsd/context_gl_x11.cpp b/platform/linuxbsd/context_gl_x11.cpp index 5442af3bef..71dc9602b3 100644 --- a/platform/linuxbsd/context_gl_x11.cpp +++ b/platform/linuxbsd/context_gl_x11.cpp @@ -46,22 +46,18 @@ typedef GLXContext (*GLXCREATECONTEXTATTRIBSARBPROC)(Display *, GLXFBConfig, GLXContext, Bool, const int *); struct ContextGL_X11_Private { - ::GLXContext glx_context; }; void ContextGL_X11::release_current() { - - glXMakeCurrent(x11_display, None, NULL); + glXMakeCurrent(x11_display, None, nullptr); } void ContextGL_X11::make_current() { - glXMakeCurrent(x11_display, x11_window, p->glx_context); } void ContextGL_X11::swap_buffers() { - glXSwapBuffers(x11_display, x11_window); } @@ -85,7 +81,6 @@ static void set_class_hint(Display *p_display, Window p_window) { } Error ContextGL_X11::initialize() { - //const char *extensions = glXQueryExtensionsString(x11_display, DefaultScreen(x11_display)); GLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = (GLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress((const GLubyte *)"glXCreateContextAttribsARB"); @@ -117,7 +112,7 @@ Error ContextGL_X11::initialize() { int fbcount; GLXFBConfig fbconfig = 0; - XVisualInfo *vi = NULL; + XVisualInfo *vi = nullptr; XSetWindowAttributes swa; swa.event_mask = StructureNotifyMask; @@ -136,7 +131,7 @@ Error ContextGL_X11::initialize() { XRenderPictFormat *pict_format = XRenderFindVisualFormat(x11_display, vi->visual); if (!pict_format) { XFree(vi); - vi = NULL; + vi = nullptr; continue; } @@ -167,7 +162,6 @@ Error ContextGL_X11::initialize() { switch (context_type) { case GLES_2_0_COMPATIBLE: { - p->glx_context = glXCreateNewContext(x11_display, fbconfig, GLX_RGBA_TYPE, 0, true); ERR_FAIL_COND_V(!p->glx_context, ERR_UNCONFIGURED); } break; @@ -192,7 +186,6 @@ Error ContextGL_X11::initialize() { } int ContextGL_X11::get_window_width() { - XWindowAttributes xwa; XGetWindowAttributes(x11_display, x11_window, &xwa); @@ -208,9 +201,9 @@ int ContextGL_X11::get_window_height() { void ContextGL_X11::set_use_vsync(bool p_use) { static bool setup = false; - static PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT = NULL; - static PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalMESA = NULL; - static PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = NULL; + static PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT = nullptr; + static PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalMESA = nullptr; + static PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = nullptr; if (!setup) { setup = true; @@ -234,14 +227,13 @@ void ContextGL_X11::set_use_vsync(bool p_use) { return; use_vsync = p_use; } -bool ContextGL_X11::is_using_vsync() const { +bool ContextGL_X11::is_using_vsync() const { return use_vsync; } ContextGL_X11::ContextGL_X11(::Display *p_x11_display, ::Window &p_x11_window, const OS::VideoMode &p_default_video_mode, ContextType p_context_type) : x11_window(p_x11_window) { - default_video_mode = p_default_video_mode; x11_display = p_x11_display; |