From e4d142fa647f470a9dd434fb89db4425c9b3f527 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 20 Mar 2009 18:40:32 +0000 Subject: Fix GLProfile.isGL2ES[12](), adding GLProfile.hasGLSL() git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1896 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 2 +- src/jogl/classes/javax/media/opengl/GLProfile.java | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl') diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index 5a3f9f4e9..7e46b822c 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -104,7 +104,7 @@ public abstract class GLDrawableFactory { } catch (Exception e) { e.printStackTrace(); } - } else if (!GLProfile.isGL2() && !GLProfile.isGL2ES1() && !GLProfile.isGL2ES2()) { + } else if (!GLProfile.isGL2ES1() && !GLProfile.isGL2ES2()) { // We require that the user passes in one of the known profiles throw new GLException("Unknown or unsupported profile \"" + GLProfile.getProfile() + "\""); } diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 1ac09c12e..8c5d8a3bf 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -201,12 +201,14 @@ public class GLProfile { return GLES2.equals(profile); } + /* Indicates whether a GL2ES1 capable profile is in use, ie GL2ES1, GL2, GLES1 */ public static final boolean isGL2ES1() { - return GL2ES1.equals(profile); + return GL2ES1.equals(profile) || isGL2() || isGLES1() ; } + /* Indicates whether a GL2ES2 capable profile is in use, ie GL2ES2, GL2, GLES2 */ public static final boolean isGL2ES2() { - return GL2ES2.equals(profile); + return GL2ES2.equals(profile) || isGL2() || isGLES2() ; } /** Indicates whether either of the OpenGL ES profiles are in use. */ @@ -214,6 +216,11 @@ public class GLProfile { return isGLES2() || isGLES1(); } + /** Indicates whether a GLSL capable profiles is in use. */ + public static final boolean hasGLSL() { + return isGL2ES2(); + } + public static final boolean matches(String test_profile) { return (null==test_profile)?false:test_profile.equals(profile); } -- cgit v1.2.3