diff options
author | Sven Gothel <[email protected]> | 2010-04-16 05:40:09 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-16 05:40:09 +0200 |
commit | 60da84a5ca8fa5e74e995ad0343c8967ba9463a5 (patch) | |
tree | 629622e0882c754b9a1d1af4accb4d8206f4c2d6 /src/jogl/classes/com/jogamp/opengl/impl/egl | |
parent | 3d8679872f38a56026d87838451eb84da54509f6 (diff) |
Fix broken Offscreen/Pbuffer query introduced in bd4904fb04ab2168aeaf76e74385b3991429289a
- Have to set the requested values in GLCapabilities if not relaxed and valid,
otherwise the result is always onscreen, since the onscreen/pbuffer bits
can be set for the same config.
- Let GLContext implementations throw an Exception
in case of no surface handle.
JUnit Tests:
- MiscUtils.setField -> MiscUtils.setFieldIfExists
To allow _not_ throwing an exception :)
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl/egl')
-rwxr-xr-x | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java | 3 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java index 31dbd46ae..8c3e9a1c4 100755 --- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLContext.java @@ -90,8 +90,7 @@ public abstract class EGLContext extends GLContextImpl { protected int makeCurrentImpl() throws GLException { if(EGL.EGL_NO_DISPLAY==((EGLDrawable)drawable).getDisplay() ) { - System.err.println("drawable not properly initialized"); - return CONTEXT_NOT_CURRENT; + throw new GLException("drawable not properly initialized: "+drawable); } boolean created = false; if (eglContext == 0) { diff --git a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java index 176628633..2d5154442 100644 --- a/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java +++ b/src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfiguration.java @@ -179,7 +179,11 @@ public class EGLGraphicsConfiguration extends DefaultGraphicsConfiguration imple } */ } if(EGL.eglGetConfigAttrib(display, config, EGL.EGL_SURFACE_TYPE, val, 0)) { - if(EGLConfigDrawableTypeVerify(val[0], onscreen, usePBuffer) || relaxed) { + if(EGLConfigDrawableTypeVerify(val[0], onscreen, usePBuffer)) { + caps.setDoubleBuffered(onscreen); + caps.setOnscreen(onscreen); + caps.setPBuffer(usePBuffer); + } else if(relaxed) { caps.setDoubleBuffered( 0 != (val[0] & EGL.EGL_WINDOW_BIT) ); caps.setOnscreen( 0 != (val[0] & EGL.EGL_WINDOW_BIT) ); caps.setPBuffer ( 0 != (val[0] & EGL.EGL_PBUFFER_BIT) ); |