kwin/glx: Try to create an OpenGL 3.1 core context

This commit is contained in:
Fredrik Höglund 2013-03-13 16:24:55 +01:00
parent b0cc22acbb
commit 26f23b656b

View file

@ -138,8 +138,23 @@ bool GlxBackend::initRenderingContext()
// Use glXCreateContextAttribsARB() when it's available
if (glXCreateContextAttribsARB) {
int attribs[] = { 0 };
ctx = glXCreateContextAttribsARB(display(), fbconfig, 0, direct, attribs);
const int attribs_31_core[] = {
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 1,
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
0
};
const int attribs_legacy[] = {
0
};
// Try to create a 3.1 context first
if (options->glCoreProfile())
ctx = glXCreateContextAttribsARB(display(), fbconfig, 0, direct, attribs_31_core);
if (!ctx)
ctx = glXCreateContextAttribsARB(display(), fbconfig, 0, direct, attribs_legacy);
}
if (!ctx)