From c1c8dcbb0d51e4e2a902db129e5a6991d84c5fc9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 31 Jul 2011 19:25:13 +0200 Subject: JOGL: Add GLBase::isGLES2Compatible() Indicates whether this GL object is compatible with OpenGL ES2, i.e. has the extension GL_ARB_ES2_compatibility --- make/config/jogl/gl-impl-CustomJavaCode-desktop.java | 4 ++++ make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 4 ++++ make/config/jogl/gl-impl-CustomJavaCode-gles2.java | 4 ++++ make/config/jogl/gl2_es2-common.cfg | 10 +++++----- 4 files changed, 17 insertions(+), 5 deletions(-) (limited to 'make/config') diff --git a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java index 4edb28272..34013209f 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java @@ -32,6 +32,10 @@ return _context.isGL2ES2(); } + public final boolean isGLES2Compatible() { + return _context.isGLES2Compatible(); + } + public final boolean isGL2GL3() { return _context.isGL2GL3(); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index 98ec4e550..8b6d1dadc 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -46,6 +46,10 @@ public final boolean isGL2ES2() { return false; } +public final boolean isGLES2Compatible() { + return false; +} + public final boolean isGL2GL3() { return false; } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java index 760ec375e..b009d935b 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java @@ -50,6 +50,10 @@ public final boolean isGL2ES2() { return true; } +public final boolean isGLES2Compatible() { + return true; +} + public final boolean isGL2GL3() { return false; } diff --git a/make/config/jogl/gl2_es2-common.cfg b/make/config/jogl/gl2_es2-common.cfg index 89f30a941..d26c76ead 100644 --- a/make/config/jogl/gl2_es2-common.cfg +++ b/make/config/jogl/gl2_es2-common.cfg @@ -1,22 +1,22 @@ -JavaPrologue glReleaseShaderCompiler if ( !_context.hasNativeES2Methods() ) { +JavaPrologue glReleaseShaderCompiler if ( !_context.isGLES2Compatible() ) { JavaPrologue glReleaseShaderCompiler return; JavaPrologue glReleaseShaderCompiler } -JavaPrologue glShaderBinary if ( !_context.hasNativeES2Methods() ) { +JavaPrologue glShaderBinary if ( !_context.isGLES2Compatible() ) { JavaPrologue glShaderBinary throw new GLException("Method \"glShaderBinary\" not available"); JavaPrologue glShaderBinary } -JavaPrologue glGetShaderPrecisionFormat if ( !_context.hasNativeES2Methods() ) { +JavaPrologue glGetShaderPrecisionFormat if ( !_context.isGLES2Compatible() ) { JavaPrologue glGetShaderPrecisionFormat throw new GLException("Method \"glGetShaderPrecisionFormat\" not available"); JavaPrologue glGetShaderPrecisionFormat } -JavaPrologue glDepthRangef if ( !_context.hasNativeES2Methods() ) { +JavaPrologue glDepthRangef if ( !_context.isGLES2Compatible() ) { JavaPrologue glDepthRangef glDepthRange( (double)zNear, (double)zFar ); JavaPrologue glDepthRangef return; JavaPrologue glDepthRangef } -JavaPrologue glClearDepthf if ( !_context.hasNativeES2Methods() ) { +JavaPrologue glClearDepthf if ( !_context.isGLES2Compatible() ) { JavaPrologue glClearDepthf glClearDepth( (double)depth ); JavaPrologue glClearDepthf return; JavaPrologue glClearDepthf } -- cgit v1.2.3