summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-03-06 09:59:34 +0100
committerSven Gothel <[email protected]>2012-03-06 09:59:34 +0100
commit3fbcf164be214f3c36bfc062e3ef63ddcc2e1687 (patch)
tree7172ac49435fc1cce26c82809b93322d1e72df0e /src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
parentefa70cd39e1a2ac18c3e8660f8d57e4569b19018 (diff)
NativeWindow public* reorg 3/3 ; NativeVisualID -> VisualIDHolder incl. proper utilization.
- VisualIDHolder: Update documentation (Exception case, etc) - NativeVisualID -> VisualIDHolder (public) - incl. generic Comparator - better doc and enum values - VID_UNDEFINED == 0 - methods shall not throw exception, but return UNDEFINED - CapabilitiesImmutable extends VisualIDHolder - All Capabilties impl. - use VID_UNDEFINED for undef. value - use final private (immutable) fields - AbstractGraphicsConfiguration extends VisualIDHolder - X11 CreateDummyWindow takes (int) visualID
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
index 70f62e3e6..35e30c5f4 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -42,6 +42,7 @@ import java.util.ArrayList;
import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.nativewindow.AbstractGraphicsScreen;
import javax.media.nativewindow.GraphicsConfigurationFactory;
+import javax.media.nativewindow.VisualIDHolder;
import javax.media.opengl.DefaultGLCapabilitiesChooser;
import javax.media.opengl.GLCapabilitiesChooser;
import javax.media.opengl.GLCapabilitiesImmutable;
@@ -170,6 +171,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
final IntBuffer val = Buffers.newDirectIntBuffer(1);
final int cfgID;
final int rType;
+ final int visualID;
// get the configID
if(!EGL.eglGetConfigAttrib(display, config, EGL.EGL_CONFIG_ID, val)) {
@@ -188,10 +190,16 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return false;
}
rType = val.get(0);
+
+ if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_NATIVE_VISUAL_ID, val)) {
+ visualID = val.get(0);
+ } else {
+ visualID = VisualIDHolder.VID_UNDEFINED;
+ }
EGLGLCapabilities caps = null;
try {
- caps = new EGLGLCapabilities(config, cfgID, glp, rType);
+ caps = new EGLGLCapabilities(config, cfgID, visualID, glp, rType);
} catch (GLException gle) {
if(DEBUG) {
System.err.println("config "+toHexString(config)+": "+gle);
@@ -199,10 +207,6 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
return false;
}
- // Read the actual configuration into the chosen caps
- if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_NATIVE_VISUAL_ID, val)) {
- caps.setNativeVisualID(val.get(0));
- }
if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_RED_SIZE, val)) {
caps.setRedBits(val.get(0));
}