diff options
author | Sven Gothel <[email protected]> | 2011-09-14 13:08:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-14 13:08:16 +0200 |
commit | f45753d2da46786b023166f805bacbc3bdce71c1 (patch) | |
tree | f927ebbd2fd82b60cf279132c0b04f75defe21ce /src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java | |
parent | 430eff8c3ffab8c69c149ba1c633d2b03f2ef2d3 (diff) |
Fix X11/Translucency (NV): Don't enable GLX.GLX_TRANSPARENT_TYPE; Always chooseConfig if translucent
Don't enable GLX.GLX_TRANSPARENT_TYPE (X11)
- if enabled, NV driver results in odd transparency effect (very high transparency)
Always chooseConfig if translucent (X11)
- recommended idx shall stay -1 if translucent,
allowing our default chooser to pick up the proper config.
this was previous reached due to the unavailable GLX_TRANSPARENT_TYPE
request, which is now removed (see above)
Allow translucency for non FBConfig, XVisual's only
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java index 03d676ec9..0f8b94825 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java @@ -232,7 +232,6 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF GLCapabilitiesImmutable capsReq, GLCapabilitiesChooser chooser, X11GraphicsScreen x11Screen) { - long recommendedFBConfig = -1; int recommendedIndex = -1; PointerBuffer fbcfgsL = null; GLProfile glProfile = capsChosen.getGLProfile(); @@ -262,12 +261,11 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF } } if(availableCaps.size() > 0) { - recommendedFBConfig = fbcfgsL.get(0); - recommendedIndex=0; + recommendedIndex = capsChosen.isBackgroundOpaque() ? 0 : -1; // only use recommended idx if not translucent if (DEBUG) { - System.err.println("!!! glXChooseFBConfig recommended fbcfg " + toHexString(recommendedFBConfig) + ", idx " + recommendedIndex); + System.err.println("!!! glXChooseFBConfig recommended fbcfg " + toHexString(fbcfgsL.get(0)) + ", idx " + recommendedIndex); System.err.println("!!! user caps " + capsChosen); - System.err.println("!!! fbcfg caps " + availableCaps.get(recommendedIndex)); + System.err.println("!!! fbcfg caps " + availableCaps.get(0)); } } else if (DEBUG) { System.err.println("!!! glXChooseFBConfig no caps for recommended fbcfg " + toHexString(fbcfgsL.get(0))); @@ -278,7 +276,6 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF // 2nd choice: get all GLCapabilities available, no preferred recommendedIndex available if( 0 == availableCaps.size() ) { // reset .. - recommendedFBConfig = -1; recommendedIndex = -1; fbcfgsL = GLX.glXChooseFBConfig(display, screen, null, 0, count, 0); @@ -355,8 +352,8 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF System.err.println("X11GLXGraphicsConfiguration.getAvailableGLCapabilitiesXVisual: XVisual invalid: ("+x11Screen+"): fbcfg: "+toHexString(infos[i].getVisualid())); } } else { - // Attempt to find the visual chosenIndex by glXChooseVisual - if (recommendedVis != null && recommendedVis.getVisualid() == infos[i].getVisualid()) { + // Attempt to find the visual chosenIndex by glXChooseVisual, if not translucent + if (capsChosen.isBackgroundOpaque() && recommendedVis != null && recommendedVis.getVisualid() == infos[i].getVisualid()) { recommendedIndex = availableCaps.size() - 1; } } |