diff options
author | Sven Gothel <[email protected]> | 2012-04-03 18:22:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-04-03 18:22:06 +0200 |
commit | 0d12af05128da433aa7b6767ba5a7f6ee9bce6c4 (patch) | |
tree | adac1f8697b68bd8701f3c7525af95e71cf24336 /src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java | |
parent | 01766fba27a35ab22908e4580c3783ceb9e5a6d1 (diff) |
EGLConfig2Capabilities: Add flag 'forceTransparentFlag' allowing to pass through transparency flag from higher API
The above is necessary to reflect transparency in chosen Capabilities from a higher level API (native windowing)
in case the EGL impl. does not (buggy). This is currently true for Android.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java index 9f9a7b9c4..875bcb95b 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java @@ -83,7 +83,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple } final long cfg = EGLConfigId2EGLConfig(dpy, cfgID); if(0 < cfg) { - final EGLGLCapabilities caps = EGLConfig2Capabilities(capsRequested.getGLProfile(), dpy, cfg, false, capsRequested.isOnscreen(), capsRequested.isPBuffer()); + final EGLGLCapabilities caps = EGLConfig2Capabilities(capsRequested.getGLProfile(), dpy, cfg, false, capsRequested.isOnscreen(), capsRequested.isPBuffer(), false); return new EGLGraphicsConfiguration(absScreen, caps, capsRequested, new DefaultGLCapabilitiesChooser()); } return null; @@ -148,12 +148,12 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple } public static EGLGLCapabilities EGLConfig2Capabilities(GLProfile glp, long display, long config, - boolean relaxed, boolean onscreen, boolean usePBuffer) { + boolean relaxed, boolean onscreen, boolean usePBuffer, boolean forceTransparentFlag) { ArrayList bucket = new ArrayList(); final int winattrmask = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, usePBuffer); - if( EGLConfig2Capabilities(bucket, glp, display, config, winattrmask) ) { + if( EGLConfig2Capabilities(bucket, glp, display, config, winattrmask, forceTransparentFlag) ) { return (EGLGLCapabilities) bucket.get(0); - } else if ( relaxed && EGLConfig2Capabilities(bucket, glp, display, config, GLGraphicsConfigurationUtil.ALL_BITS) ) { + } else if ( relaxed && EGLConfig2Capabilities(bucket, glp, display, config, GLGraphicsConfigurationUtil.ALL_BITS, forceTransparentFlag) ) { return (EGLGLCapabilities) bucket.get(0); } return null; @@ -161,7 +161,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple public static boolean EGLConfig2Capabilities(ArrayList capsBucket, GLProfile glp, long display, long config, - int winattrmask) { + int winattrmask, boolean forceTransparentFlag) { final int allDrawableTypeBits = EGLConfigDrawableTypeBits(display, config); final int drawableTypeBits = winattrmask & allDrawableTypeBits; @@ -241,7 +241,9 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple } } } - if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_TYPE, val)) { + if(forceTransparentFlag) { + caps.setBackgroundOpaque(false); + } else if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_TRANSPARENT_TYPE, val)) { caps.setBackgroundOpaque(val.get(0) != EGL.EGL_TRANSPARENT_RGB); } if(!caps.isBackgroundOpaque()) { |