diff options
Diffstat (limited to 'Source/Core/Common/GL/GLInterface/GLX.cpp')
| -rw-r--r-- | Source/Core/Common/GL/GLInterface/GLX.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Source/Core/Common/GL/GLInterface/GLX.cpp b/Source/Core/Common/GL/GLInterface/GLX.cpp index 70ee8485b2..052dbbf6a1 100644 --- a/Source/Core/Common/GL/GLInterface/GLX.cpp +++ b/Source/Core/Common/GL/GLInterface/GLX.cpp @@ -54,11 +54,18 @@ void GLContextGLX::SwapInterval(int Interval) // Try EXT_swap_control, then MESA_swap_control. if (glXSwapIntervalEXTPtr) + { glXSwapIntervalEXTPtr(m_display, m_drawable, Interval); + } else if (glXSwapIntervalMESAPtr) + { glXSwapIntervalMESAPtr(static_cast<unsigned int>(Interval)); + } else - ERROR_LOG(VIDEO, "No support for SwapInterval (framerate clamped to monitor refresh rate)."); + { + ERROR_LOG_FMT(VIDEO, + "No support for SwapInterval (framerate clamped to monitor refresh rate)."); + } } void* GLContextGLX::GetFuncAddress(const std::string& name) @@ -83,8 +90,8 @@ bool GLContextGLX::Initialize(const WindowSystemInfo& wsi, bool stereo, bool cor glXQueryVersion(m_display, &glxMajorVersion, &glxMinorVersion); if (glxMajorVersion < 1 || (glxMajorVersion == 1 && glxMinorVersion < 4)) { - ERROR_LOG(VIDEO, "glX-Version %d.%d detected, but need at least 1.4", glxMajorVersion, - glxMinorVersion); + ERROR_LOG_FMT(VIDEO, "glX-Version {}.{} detected, but need at least 1.4", glxMajorVersion, + glxMinorVersion); return false; } @@ -93,8 +100,8 @@ bool GLContextGLX::Initialize(const WindowSystemInfo& wsi, bool stereo, bool cor (PFNGLXCREATECONTEXTATTRIBSPROC)GetFuncAddress("glXCreateContextAttribsARB"); if (!glXCreateContextAttribs) { - ERROR_LOG(VIDEO, - "glXCreateContextAttribsARB not found, do you support GLX_ARB_create_context?"); + ERROR_LOG_FMT(VIDEO, + "glXCreateContextAttribsARB not found, do you support GLX_ARB_create_context?"); return false; } @@ -124,7 +131,7 @@ bool GLContextGLX::Initialize(const WindowSystemInfo& wsi, bool stereo, bool cor GLXFBConfig* fbc = glXChooseFBConfig(m_display, screen, visual_attribs, &fbcount); if (!fbc || !fbcount) { - ERROR_LOG(VIDEO, "Failed to retrieve a framebuffer config"); + ERROR_LOG_FMT(VIDEO, "Failed to retrieve a framebuffer config"); return false; } m_fbconfig = *fbc; @@ -150,7 +157,8 @@ bool GLContextGLX::Initialize(const WindowSystemInfo& wsi, bool stereo, bool cor continue; // Got a context. - INFO_LOG(VIDEO, "Created a GLX context with version %d.%d", version.first, version.second); + INFO_LOG_FMT(VIDEO, "Created a GLX context with version {}.{}", version.first, + version.second); m_attribs.insert(m_attribs.end(), context_attribs.begin(), context_attribs.end()); break; } @@ -169,7 +177,7 @@ bool GLContextGLX::Initialize(const WindowSystemInfo& wsi, bool stereo, bool cor } if (!m_context || s_glxError) { - ERROR_LOG(VIDEO, "Unable to create GL context."); + ERROR_LOG_FMT(VIDEO, "Unable to create GL context."); XSetErrorHandler(oldHandler); return false; } @@ -206,7 +214,7 @@ bool GLContextGLX::Initialize(const WindowSystemInfo& wsi, bool stereo, bool cor if (!CreateWindowSurface(reinterpret_cast<Window>(wsi.render_surface))) { - ERROR_LOG(VIDEO, "Error: CreateWindowSurface failed\n"); + ERROR_LOG_FMT(VIDEO, "Error: CreateWindowSurface failed\n"); XSetErrorHandler(oldHandler); return false; } @@ -227,7 +235,7 @@ std::unique_ptr<GLContext> GLContextGLX::CreateSharedContext() if (!new_glx_context || s_glxError) { - ERROR_LOG(VIDEO, "Unable to create GL context."); + ERROR_LOG_FMT(VIDEO, "Unable to create GL context."); XSetErrorHandler(oldHandler); return nullptr; } @@ -242,7 +250,7 @@ std::unique_ptr<GLContext> GLContextGLX::CreateSharedContext() if (m_supports_pbuffer && !new_context->CreateWindowSurface(None)) { - ERROR_LOG(VIDEO, "Error: CreateWindowSurface failed"); + ERROR_LOG_FMT(VIDEO, "Error: CreateWindowSurface failed"); XSetErrorHandler(oldHandler); return nullptr; } |
