From 2448ef91fddecdd876ac81746e12c2a1291e82fa Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 6 Aug 2011 10:07:47 +0200 Subject: EGL Fix: Use config-id value, bug override it w/ renderable type --- .../classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java index 8de590879..b30089faa 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java @@ -155,10 +155,11 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple return false; } - int[] val = new int[1]; + int[] cfgID = new int[1]; + int[] rType = new int[1]; // get the configID - if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, val, 0)) { + if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, cfgID, 0)) { if(DEBUG) { // FIXME: this happens on a ATI PC Emulation .. System.err.println("EGL couldn't retrieve ConfigID for config "+toHexString(config)+", error "+toHexString(EGL.eglGetError())); @@ -166,7 +167,7 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple return false; } - if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_RENDERABLE_TYPE, val, 0)) { + if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_RENDERABLE_TYPE, rType, 0)) { if(DEBUG) { System.err.println("EGL couldn't retrieve EGL_RENDERABLE_TYPE for config "+toHexString(config)+", error "+toHexString(EGL.eglGetError())); } @@ -174,7 +175,7 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple } EGLGLCapabilities caps = null; try { - caps = new EGLGLCapabilities(config, val[0], glp, val[0]); + caps = new EGLGLCapabilities(config, cfgID[0], glp, rType[0]); } catch (GLException gle) { if(DEBUG) { System.err.println("config "+toHexString(config)+": "+gle); @@ -182,6 +183,8 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple return false; } + int[] val = new int[1]; + // Read the actual configuration into the chosen caps if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_RED_SIZE, val, 0)) { caps.setRedBits(val[0]); -- cgit v1.2.3