aboutsummaryrefslogtreecommitdiffstats
path: root/make/gl-impl-CustomJavaCode-common.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-06-21 02:33:51 +0000
committerSven Gothel <[email protected]>2008-06-21 02:33:51 +0000
commit006acbb9463af33a8b45aa0b3a298604eba72d82 (patch)
tree2c71662575a2c098b22c4b19b471bb5c732041c5 /make/gl-impl-CustomJavaCode-common.java
parentcbc45e816f4ee81031bffce19a99550681462a24 (diff)
2nd big refactoring.
Goals are orthogonal components for: - OS Windowing system - NEWT, X11, Windows, MacOsX - GL Windowing GLUE - EGL, GLX, WGL, CGL - GL profiles - core and util packages - generate all Java components from any platform All above goals are achieved. TODO: - Native compilation fix and test - Check/Fix Win32, MacOSX and the mobile devices - .. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1665 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/gl-impl-CustomJavaCode-common.java')
-rw-r--r--make/gl-impl-CustomJavaCode-common.java85
1 files changed, 85 insertions, 0 deletions
diff --git a/make/gl-impl-CustomJavaCode-common.java b/make/gl-impl-CustomJavaCode-common.java
new file mode 100644
index 000000000..0829d588a
--- /dev/null
+++ b/make/gl-impl-CustomJavaCode-common.java
@@ -0,0 +1,85 @@
+ public final boolean isGL2() {
+ return GLProfile.implementationOfGL2(this);
+ }
+
+ public final boolean isGLES1() {
+ return GLProfile.implementationOfGLES1(this);
+ }
+
+ public final boolean isGLES2() {
+ return GLProfile.implementationOfGLES2(this);
+ }
+
+ public final boolean isGLES() {
+ return GLProfile.implementationOfGLES(this);
+ }
+
+ public final boolean isGL2ES1() {
+ return GLProfile.implementationOfGL2ES1(this);
+ }
+
+ public final boolean isGL2ES2() {
+ return GLProfile.implementationOfGL2ES2(this);
+ }
+
+ public final GL2 getGL2() throws GLException {
+ if(!isGL2()) {
+ throw new GLException("Not a GL2implementation");
+ }
+ return (GL2)this;
+ }
+
+ public final GLES1 getGLES1() throws GLException {
+ if(!isGLES1()) {
+ throw new GLException("Not a GLES1 implementation");
+ }
+ return (GLES1)this;
+ }
+
+ public final GLES2 getGLES2() throws GLException {
+ if(!isGLES2()) {
+ throw new GLException("Not a GLES2 implementation");
+ }
+ return (GLES2)this;
+ }
+
+ public final GL2ES1 getGL2ES1() throws GLException {
+ if(!isGL2ES1()) {
+ throw new GLException("Not a GL2ES1 implementation");
+ }
+ return (GL2ES1)this;
+ }
+
+ public final GL2ES2 getGL2ES2() throws GLException {
+ if(!isGL2ES2()) {
+ throw new GLException("Not a GL2ES2 implementation");
+ }
+ return (GL2ES2)this;
+ }
+
+ public final boolean matchesProfile() {
+ return matchesProfile(GLProfile.getProfile());
+ }
+
+ public final boolean matchesProfile(String test_profile) {
+ if(null==test_profile) {
+ return false;
+ }
+ if(test_profile.equals(GLProfile.GL2)) {
+ return isGL2();
+ }
+ if(test_profile.equals(GLProfile.GLES1)) {
+ return isGLES1();
+ }
+ if(test_profile.equals(GLProfile.GLES2)) {
+ return isGLES2();
+ }
+ return false;
+ }
+
+ public final String toString() {
+ return "GL: "+getClass().getName()+
+ "(GLContext: "+getContext().getClass().getName()+","+
+ " Factory: "+ getContext().getGLDrawable().getFactory().getClass().getName()+")";
+ }
+