diff options
author | Sven Gothel <[email protected]> | 2015-03-06 10:01:02 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-06 10:01:02 +0100 |
commit | eced1d4e45772a862d649e3cd7b500c6bc1643a1 (patch) | |
tree | a226e0549ffce207dd7625597c2d969405a4c68d /src/jogl/classes/jogamp/opengl/GLContextImpl.java | |
parent | 807c86913b465ce6071bc1af7ba6f8620cd5e772 (diff) |
Bug 1135 - GL/GLContext: Add isGLES31Compatible()
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLContextImpl.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 928ed0284..c56dc74da 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -41,7 +41,6 @@ package jogamp.opengl; import java.lang.reflect.Method; -import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.security.AccessController; import java.security.PrivilegedAction; @@ -1319,9 +1318,11 @@ public abstract class GLContextImpl extends GLContext { name. Currently not used. */ protected final String mapToRealGLFunctionName(final String glFunctionName) { final Map<String, String> map = getFunctionNameMap(); - final String lookup = ( null != map ) ? map.get(glFunctionName) : null; - if (lookup != null) { - return lookup; + if( null != map ) { + final String lookup = map.get(glFunctionName); + if (lookup != null) { + return lookup; + } } return glFunctionName; } @@ -1334,9 +1335,11 @@ public abstract class GLContextImpl extends GLContext { */ protected final String mapToRealGLExtensionName(final String glExtensionName) { final Map<String, String> map = getExtensionNameMap(); - final String lookup = ( null != map ) ? map.get(glExtensionName) : null; - if (lookup != null) { - return lookup; + if( null != map ) { + final String lookup = map.get(glExtensionName); + if (lookup != null) { + return lookup; + } } return glExtensionName; } @@ -1654,7 +1657,7 @@ public abstract class GLContextImpl extends GLContext { } if( major < 2 ) { // there is no ES2/3-compat for a profile w/ major < 2 - ctxProfileBits &= ~ ( GLContext.CTX_IMPL_ES2_COMPAT | GLContext.CTX_IMPL_ES3_COMPAT ) ; + ctxProfileBits &= ~ ( GLContext.CTX_IMPL_ES2_COMPAT | GLContext.CTX_IMPL_ES3_COMPAT | GLContext.CTX_IMPL_ES31_COMPAT ) ; } if(!isCurrentContextHardwareRasterizer()) { @@ -1748,10 +1751,19 @@ public abstract class GLContextImpl extends GLContext { if( major >= 3 ) { ctxProfileBits |= CTX_IMPL_ES3_COMPAT | CTX_IMPL_ES2_COMPAT ; ctxProfileBits |= CTX_IMPL_FBO; + if( minor >= 1 ) { + ctxProfileBits |= CTX_IMPL_ES31_COMPAT; + } } else if( major >= 2 ) { ctxProfileBits |= CTX_IMPL_ES2_COMPAT; ctxProfileBits |= CTX_IMPL_FBO; } + } else if( ( major > 4 || major == 4 && minor >= 5 ) || + ( ( major > 3 || major == 3 && minor >= 1 ) && isExtensionAvailable( GLExtensions.ARB_ES3_1_compatibility ) ) ) { + // See GLContext.isGLES31CompatibleAvailable(..)/isGLES31Compatible() + // Includes [ GL ≥ 4.5, GL ≥ 3.1 w/ GL_ARB_ES3_1_compatibility and GLES ≥ 3.1 ] + ctxProfileBits |= CTX_IMPL_ES31_COMPAT | CTX_IMPL_ES3_COMPAT | CTX_IMPL_ES2_COMPAT ; + ctxProfileBits |= CTX_IMPL_FBO; } else if( ( major > 4 || major == 4 && minor >= 3 ) || ( ( major > 3 || major == 3 && minor >= 1 ) && isExtensionAvailable( GLExtensions.ARB_ES3_compatibility ) ) ) { // See GLContext.isGLES3CompatibleAvailable(..)/isGLES3Compatible() @@ -2424,10 +2436,10 @@ public abstract class GLContextImpl extends GLContext { } switch(target) { case GL.GL_FRAMEBUFFER: - case GL2ES3.GL_DRAW_FRAMEBUFFER: + case GL.GL_DRAW_FRAMEBUFFER: boundFBOTarget[0] = framebufferName; // draw break; - case GL2ES3.GL_READ_FRAMEBUFFER: + case GL.GL_READ_FRAMEBUFFER: boundFBOTarget[1] = framebufferName; // read break; default: // ignore untracked target @@ -2437,9 +2449,9 @@ public abstract class GLContextImpl extends GLContext { public final int getBoundFramebuffer(final int target) { switch(target) { case GL.GL_FRAMEBUFFER: - case GL2ES3.GL_DRAW_FRAMEBUFFER: + case GL.GL_DRAW_FRAMEBUFFER: return boundFBOTarget[0]; // draw - case GL2ES3.GL_READ_FRAMEBUFFER: + case GL.GL_READ_FRAMEBUFFER: return boundFBOTarget[1]; // read default: throw new InternalError("Invalid FBO target name: "+toHexString(target)); |