aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-11-19 17:22:06 +0000
committerSven Gothel <[email protected]>2008-11-19 17:22:06 +0000
commitf38666efc700ad0a5550932bda251436dc9fa40c (patch)
tree1411df1de9825eca1ba242f209b3516485f74336 /src/classes/com/sun/opengl/impl/egl/EGLDrawable.java
parent22c546d01ea65350e6fc59064a6ca8c99e198ba4 (diff)
EGLDrawable: Update the capabilities to the chosen one by EGL
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1793 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/egl/EGLDrawable.java')
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/egl/EGLDrawable.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java b/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java
index 60aed64be..c18af5a89 100755
--- a/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java
@@ -51,7 +51,6 @@ public class EGLDrawable extends GLDrawableImpl {
GLCapabilities capabilities,
GLCapabilitiesChooser chooser) throws GLException {
super(factory, component, false);
- setChosenGLCapabilities(capabilities);
this.chooser = chooser;
surface=EGL.EGL_NO_SURFACE;
@@ -75,6 +74,27 @@ public class EGLDrawable extends GLDrawableImpl {
throw new GLException("No valid graphics configuration selected from eglChooseConfig");
}
config = configs[0];
+ // Read the actual configuration into the choosen caps
+ int[] val = new int[1];
+ if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_RED_SIZE, val, 0)) {
+ capabilities.setRedBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_GREEN_SIZE, val, 0)) {
+ capabilities.setGreenBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_BLUE_SIZE, val, 0)) {
+ capabilities.setBlueBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_ALPHA_SIZE, val, 0)) {
+ capabilities.setAlphaBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_STENCIL_SIZE, val, 0)) {
+ capabilities.setStencilBits(val[0]);
+ }
+ if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_DEPTH_SIZE, val, 0)) {
+ capabilities.setDepthBits(val[0]);
+ }
+ setChosenGLCapabilities(capabilities);
}
public long getDisplay() {