Don't try to use GLX 1.3 functions when it's not available
svn path=/trunk/KDE/kdebase/workspace/; revision=719170
This commit is contained in:
parent
653ec13486
commit
50bacdcfe3
1 changed files with 20 additions and 2 deletions
|
@ -63,11 +63,20 @@ void CompositingPrefs::detect()
|
|||
kDebug( 1212 ) << "No GLX available";
|
||||
return;
|
||||
}
|
||||
int glxmajor, glxminor;
|
||||
glXQueryVersion( display(), &glxmajor, &glxminor );
|
||||
kDebug() << "glx version is " << glxmajor << "." << glxminor;
|
||||
bool hasglx13 = ( glxmajor > 1 || ( glxmajor == 1 && glxminor >= 3 ));
|
||||
|
||||
// remember and later restore active context
|
||||
GLXContext oldcontext = glXGetCurrentContext();
|
||||
GLXDrawable olddrawable = glXGetCurrentDrawable();
|
||||
GLXDrawable oldreaddrawable = glXGetCurrentReadDrawable();
|
||||
GLXDrawable oldreaddrawable;
|
||||
if( hasglx13 )
|
||||
{
|
||||
oldreaddrawable = glXGetCurrentReadDrawable();
|
||||
}
|
||||
|
||||
if( createGLXContext() )
|
||||
{
|
||||
detectDriverAndVersion();
|
||||
|
@ -76,7 +85,16 @@ void CompositingPrefs::detect()
|
|||
deleteGLXContext();
|
||||
}
|
||||
if( oldcontext != NULL )
|
||||
glXMakeContextCurrent( display(), olddrawable, oldreaddrawable, oldcontext );
|
||||
{
|
||||
if( hasglx13 )
|
||||
{
|
||||
glXMakeContextCurrent( display(), olddrawable, oldreaddrawable, oldcontext );
|
||||
}
|
||||
else
|
||||
{
|
||||
glXMakeCurrent( display(), olddrawable, oldcontext );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue