aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/egl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-10-30 18:26:24 +0100
committerSven Gothel <[email protected]>2013-10-30 18:26:24 +0100
commit2481774c4a4a5d734dbeb2f7d8963f45d1b2a437 (patch)
tree29ee5725e03b41677d5170c337bfbd6f782c098c /src/jogl/classes/jogamp/opengl/egl
parent9ce3f5f0d47f21a7dc229f0df03ac0fbda295f35 (diff)
Fix Bug 875 - Cleanup branch using VersionNumber (fix 'Int' check strictMatch minor) and reuse isES; EGLContext: Use strictMatch for setGLFunctionAvailability() and handle failure; EGLDrawableFactory: Either detect ES3 or ES2.
- Cleanup branch using VersionNumber (fix 'Int' check strictMatch minor) and reuse isES - EGLContext: Use strictMatch for setGLFunctionAvailability() and handle failure On ES, we require strictMatch, cleanup if failing. - EGLDrawableFactory: Either detect ES3 or ES2. Both only available with proper EGL context creation for ES profiles (TODO)
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl')
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLContext.java16
-rw-r--r--src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java4
2 files changed, 15 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
index d8bb2e9eb..2eb277f3f 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -222,9 +222,19 @@ public class EGLContext extends GLContextImpl {
throw new GLException("Error making context " +
toHexString(contextHandle) + " current: error code " + toHexString(EGL.eglGetError()));
}
- return setGLFunctionAvailability(true, contextVersionReq, 0, CTX_PROFILE_ES,
- contextVersionReq>=3 /* strictMatch */, // strict match for es >= 3
- false /* withinGLVersionsMapping */);
+ if( !setGLFunctionAvailability(true, contextVersionReq, 0, CTX_PROFILE_ES,
+ true /* strictMatch */, // always req. strict match
+ false /* withinGLVersionsMapping */) ) {
+ if(DEBUG) {
+ System.err.println(getThreadName() + ": createImpl: setGLFunctionAvailability FAILED delete "+toHexString(contextHandle));
+ }
+ EGL.eglMakeCurrent(drawable.getNativeSurface().getDisplayHandle(), EGL.EGL_NO_SURFACE, EGL.EGL_NO_SURFACE, EGL.EGL_NO_CONTEXT);
+ EGL.eglDestroyContext(drawable.getNativeSurface().getDisplayHandle(), contextHandle);
+ contextHandle = 0;
+ return false;
+ } else {
+ return true;
+ }
}
@Override
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index a0d896e3a..87a780935 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -616,8 +616,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
if( null != eglES2DynamicLookupHelper ) {
madeCurrentES3 = mapAvailableEGLESConfig(adevice, 3, hasPBufferES3ES2, rendererQuirksES3ES2, ctpES3ES2);
if( madeCurrentES3 ) {
- madeCurrentES2 = true;
- EGLContext.mapStaticGLVersion(adevice, 2, 0, ctpES3ES2[0]);
+ // Only support highest - FIXME: Proper ES2/ES3 profile selection
+ madeCurrentES2 = false;
} else {
madeCurrentES2 = mapAvailableEGLESConfig(adevice, 2, hasPBufferES3ES2, rendererQuirksES3ES2, ctpES3ES2);
}