From 1c0366993a582e76333ed18421e92424261901f2 Mon Sep 17 00:00:00 2001 From: degasus Date: Sun, 6 Sep 2015 13:58:18 +0200 Subject: VideoBackends: Reimplement SSAA, now for D3D + OGL --- Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp | 37 +++++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp') diff --git a/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp b/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp index 623466cdbd..cd8cc5f070 100644 --- a/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp +++ b/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp @@ -94,21 +94,37 @@ bool cInterfaceGLX::Create(void *window_handle) // Get an appropriate visual XVisualInfo* vi = glXGetVisualFromFBConfig(dpy, fbconfig); + s_glxError = false; + XErrorHandler oldHandler = XSetErrorHandler(&ctxErrorHandler); + // Create a GLX context. - // We try to get a 3.3 core profile, else we try it with anything we get. + // We try to get a 4.0 core profile, else we try 3.3, else try it with anything we get. int context_attribs[] = { - GLX_CONTEXT_MAJOR_VERSION_ARB, 3, - GLX_CONTEXT_MINOR_VERSION_ARB, 3, + GLX_CONTEXT_MAJOR_VERSION_ARB, 4, + GLX_CONTEXT_MINOR_VERSION_ARB, 0, GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, None }; - s_glxError = false; - XErrorHandler oldHandler = XSetErrorHandler(&ctxErrorHandler); ctx = glXCreateContextAttribs(dpy, fbconfig, 0, True, context_attribs); XSync(dpy, False); if (!ctx || s_glxError) + { + int context_attribs_33[] = + { + GLX_CONTEXT_MAJOR_VERSION_ARB, 3, + GLX_CONTEXT_MINOR_VERSION_ARB, 3, + GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, + GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, + None + }; + s_glxError = false; + ctx = glXCreateContextAttribs(dpy, fbconfig, 0, True, context_attribs_33); + XSync(dpy, False); + + } + if (!ctx || s_glxError) { int context_attribs_legacy[] = { @@ -119,11 +135,12 @@ bool cInterfaceGLX::Create(void *window_handle) s_glxError = false; ctx = glXCreateContextAttribs(dpy, fbconfig, 0, True, context_attribs_legacy); XSync(dpy, False); - if (!ctx || s_glxError) - { - ERROR_LOG(VIDEO, "Unable to create GL context."); - return false; - } + + } + if (!ctx || s_glxError) + { + ERROR_LOG(VIDEO, "Unable to create GL context."); + return false; } XSetErrorHandler(oldHandler); -- cgit v1.2.3