From 84ad2585e13aef78c9f77a6e51391108f378efde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Wed, 13 Mar 2013 16:09:05 +0100 Subject: [PATCH] kwin: Use glXCreateContextAttribsARB() when it's supported --- glxbackend.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/glxbackend.cpp b/glxbackend.cpp index c68bceeb36..e7df14f908 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -132,12 +132,18 @@ void GlxBackend::init() kDebug(1212) << "Direct rendering:" << isDirectRendering() << endl; } - bool GlxBackend::initRenderingContext() { bool direct = options->isGlDirect(); - ctx = glXCreateNewContext(display(), fbconfig, GLX_RGBA_TYPE, NULL, direct); + // Use glXCreateContextAttribsARB() when it's available + if (glXCreateContextAttribsARB) { + int attribs[] = { 0 }; + ctx = glXCreateContextAttribsARB(display(), fbconfig, 0, direct, attribs); + } + + if (!ctx) + ctx = glXCreateNewContext(display(), fbconfig, GLX_RGBA_TYPE, NULL, direct); if (!ctx) { kDebug(1212) << "Failed to create an OpenGL context.";