From f089923fe27329fdbd886a448fd91f28a65a6a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Sat, 9 Jun 2007 07:06:11 +0000 Subject: [PATCH] Sets best values found so far only if the config passes all checks, part II. svn path=/trunk/KDE/kdebase/workspace/; revision=673163 --- scene_opengl.cpp | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index ecdb0aa55f..6b88cb86ac 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -382,34 +382,38 @@ bool SceneOpenGL::initBufferConfigs() GLX_BUFFER_SIZE, &value ); if( value != QX11Info::appDepth() && ( value - alpha ) != QX11Info::appDepth() ) continue; + int back_value; glXGetFBConfigAttrib( display(), fbconfigs[ j ], - GLX_DOUBLEBUFFER, &value ); + GLX_DOUBLEBUFFER, &back_value ); if( i > 0 ) { - if( value > back ) + if( back_value > back ) continue; } else { - if( value < back ) + if( back_value < back ) continue; } - back = value; + int stencil_value; glXGetFBConfigAttrib( display(), fbconfigs[ j ], - GLX_STENCIL_SIZE, &value ); - if( value < stencil ) + GLX_STENCIL_SIZE, &stencil_value ); + if( stencil_value < stencil ) continue; - stencil = value; + int depth_value; glXGetFBConfigAttrib( display(), fbconfigs[ j ], - GLX_DEPTH_SIZE, &value ); - if( value < depth ) + GLX_DEPTH_SIZE, &depth_value ); + if( depth_value < depth ) continue; - depth = value; + int caveat_value; glXGetFBConfigAttrib( display(), fbconfigs[ j ], - GLX_CONFIG_CAVEAT, &value ); - if( value > caveat ) + GLX_CONFIG_CAVEAT, &caveat_value ); + if( caveat_value > caveat ) continue; - caveat = value; + back = back_value; + stencil = stencil_value; + depth = depth_value; + caveat = caveat_value; if( i > 0 ) fbcbuffer_nondb = fbconfigs[ j ]; else @@ -510,13 +514,14 @@ bool SceneOpenGL::initDrawableConfigs() if( mipmap_value < mipmap ) continue; } + int caveat_value; glXGetFBConfigAttrib( display(), fbconfigs[ j ], - GLX_CONFIG_CAVEAT, &value ); - if( value > caveat ) + GLX_CONFIG_CAVEAT, &caveat_value ); + if( caveat_value > caveat ) continue; // ok, config passed all tests, it's the best one so far fbcdrawableinfo[ i ].fbconfig = fbconfigs[ j ]; - caveat = value; + caveat = caveat_value; back = back_value; stencil = stencil_value; depth = depth_value;