summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/GLInterface
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2015-09-06 13:31:49 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2015-09-06 13:31:49 -0500
commitd2ac382a146bfa64b0ce65a503c3651d0302a387 (patch)
tree15bf8911646a19fa68eebfafd11574869e6a75e0 /Source/Core/VideoBackends/OGL/GLInterface
parentc08a83a5aae41e7c8904295cfa62f932ea87ce02 (diff)
parent1c0366993a582e76333ed18421e92424261901f2 (diff)
Merge pull request #2986 from degasus/master
VideoBackends: Reimplement SSAA, now for D3D + OGL
Diffstat (limited to 'Source/Core/VideoBackends/OGL/GLInterface')
-rw-r--r--Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp37
1 files changed, 27 insertions, 10 deletions
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,22 +94,38 @@ 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[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 1,
@@ -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);