summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-07-31 20:10:16 +0200
committerSven Gothel <[email protected]>2011-07-31 20:10:16 +0200
commit03ca640b6842c6070bcc3fb76e1c3464ea5c44a1 (patch)
treea3daba6fcc0f57adce72126a6212a93f2e39e20c /src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
parent43ca6eea35ed06b462f609bd5704d9499c678927 (diff)
EGL: Query EGL_RENDERABLE_TYPE, store it in EGLGLCapabilities and test w/ GLProfile compatibility
EGLConfig's EGL_RENDERABLE_TYPE determines ES1, ES2 or VG usage (bitfield). We have to store and compare it's value w/ the desired GLProfile to choose a valid one, or just store it.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
index 4d8f2ac3e..2fad75b74 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -134,7 +134,7 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple
}
public static EGLGLCapabilities EGLConfig2Capabilities(GLProfile glp, long display, long config,
- boolean relaxed, boolean onscreen, boolean usePBuffer) {
+ boolean relaxed, boolean onscreen, boolean usePBuffer) {
ArrayList bucket = new ArrayList();
final int winattrmask = GLGraphicsConfigurationUtil.getWinAttributeBits(onscreen, usePBuffer);
if( EGLConfig2Capabilities(bucket, glp, display, config, winattrmask) ) {
@@ -165,9 +165,24 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple
}
return false;
}
- GLCapabilities caps = new EGLGLCapabilities(config, val[0], glp);
-
- // Read the actual configuration into the choosen caps
+
+ if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_RENDERABLE_TYPE, val, 0)) {
+ if(DEBUG) {
+ System.err.println("EGL couldn't retrieve EGL_RENDERABLE_TYPE for config "+toHexString(config)+", error "+toHexString(EGL.eglGetError()));
+ }
+ return false;
+ }
+ EGLGLCapabilities caps = null;
+ try {
+ caps = new EGLGLCapabilities(config, val[0], glp, val[0]);
+ } catch (GLException gle) {
+ if(DEBUG) {
+ System.err.println("config "+toHexString(config)+": "+gle);
+ }
+ return false;
+ }
+
+ // Read the actual configuration into the chosen caps
if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_RED_SIZE, val, 0)) {
caps.setRedBits(val[0]);
}