From 3e43ef1a81bca32d2840c714c8e791d192ad88cc Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 21 Jul 2008 00:18:02 +0000 Subject: - New profile GL2ES12 (desktop) - Intersection of GL2 + GLES1 + GLES2 - Common set of GLES1 + GLES2 - Utilized new 'ExtendedInterfaceSymbolsOnly' gluegen config - DroppingUniqVendorExtension + 3DFX + APPLE - Some APPLE enumerates are manually provided! - Removing of 'jogl.oswin.jar' - since it is redundant now! - Proper partitioning of 'jogl.gl2' and 'jogl.gl2es12' for - x11, win and osx - Profile selection/trial for e.g. GL2ES1 is now in the following order: 1) GLES1 2) GL2ES12 3) GL2 - Footprint for all profiles below 1/2 MB, NEWT: ES1: 284 kB ES2: 280 kB GL2ES12: 332 kB GL2: 456 kB git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1729 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../javax/media/opengl/GLDrawableFactory.java | 4 +- src/classes/javax/media/opengl/GLProfile.java | 51 +++++++++++++++++++--- 2 files changed, 46 insertions(+), 9 deletions(-) (limited to 'src/classes/javax/media') diff --git a/src/classes/javax/media/opengl/GLDrawableFactory.java b/src/classes/javax/media/opengl/GLDrawableFactory.java index a6e382760..e28c9b28e 100644 --- a/src/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/classes/javax/media/opengl/GLDrawableFactory.java @@ -95,7 +95,7 @@ public abstract class GLDrawableFactory { } catch (Exception e) { e.printStackTrace(); } - } else if (!GLProfile.isGL2()) { + } else if (!GLProfile.isGL2() && !GLProfile.isGL2ES12()) { // We require that the user passes in one of the known profiles throw new GLException("Unknown or unsupported profile \"" + GLProfile.getProfile() + "\""); } @@ -162,7 +162,7 @@ public abstract class GLDrawableFactory { } catch (Exception e) { e.printStackTrace(); } - } else if (!GLProfile.isGL2()) { + } else if (!GLProfile.isGL2() && !GLProfile.isGL2ES12()) { // 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/classes/javax/media/opengl/GLProfile.java b/src/classes/javax/media/opengl/GLProfile.java index 21dccc8ed..d4c8d4c6b 100644 --- a/src/classes/javax/media/opengl/GLProfile.java +++ b/src/classes/javax/media/opengl/GLProfile.java @@ -44,6 +44,9 @@ public class GLProfile { /** The desktop (OpenGL 2.0) profile */ public static final String GL2 = "GL2"; + /** The desktop short profile, intersecting: GL2+GLES1+GLES2 */ + public static final String GL2ES12 = "GL2ES12"; + /** The OpenGL ES 1 (really, 1.1) profile */ public static final String GLES1 = "GLES1"; @@ -56,8 +59,11 @@ public class GLProfile { private static final void tryLibrary() { try { + Class clazz = Class.forName(getGLImplBaseClassName()+"Impl"); if(GL2.equals(profile)) { NativeLibLoader.loadGL2(); + } if(GL2ES12.equals(profile)) { + NativeLibLoader.loadGL2ES12(); } else if(GLES1.equals(profile) || GLES2.equals(profile)) { Object eGLDrawableFactory = GLReflection.createInstance("com.sun.opengl.impl.egl.EGLDrawableFactory"); if(null==eGLDrawableFactory) { @@ -95,15 +101,21 @@ public class GLProfile { } } + /** + * Selects a profile, implementing the interface GL2ES1. + */ public static synchronized final void setProfileGL2ES1() { - setProfile(new String[] { GLES1, GL2 }); + setProfile(new String[] { GLES1, GL2ES12, GL2 }); if(null==profile) { throw new GLException("Profiles GLES1 and GL2 not available"); } } + /** + * Selects a profile, implementing the interface GL2ES2. + */ public static synchronized final void setProfileGL2ES2() { - setProfile(new String[] { GLES2, GL2 }); + setProfile(new String[] { GLES2, GL2ES12, GL2 }); if(null==profile) { throw new GLException("Profiles GLES2 and GL2 not available"); } @@ -113,26 +125,37 @@ public class GLProfile { return profile; } + /* true profile GL2ES12 */ + public static final boolean isGL2ES12() { + return GL2ES12.equals(profile); + } + + /* true profile GL2 */ public static final boolean isGL2() { return GL2.equals(profile); } + /* true profile GLES1 */ public static final boolean isGLES1() { return GLES1.equals(profile); } - public static final boolean isGL2ES1() { - return isGL2() || isGLES1(); - } - + /* true profile GLES2 */ public static final boolean isGLES2() { return GLES2.equals(profile); } + /* abstract profile GL2ES12, GL2, GLES1 */ + public static final boolean isGL2ES1() { + return isGL2ES12() || isGL2() || isGLES1(); + } + + /* abstract profile GL2ES12, GL2, GLES2 */ public static final boolean isGL2ES2() { - return isGL2() || isGLES2(); + return isGL2ES12() || isGL2() || isGLES2(); } + /* abstract profile GLES1, GLES2 */ public static final boolean isGLES() { return isGLES2() || isGLES1(); } @@ -165,5 +188,19 @@ public class GLProfile { return GLReflection.implementationOf(obj, "javax.media.opengl.GL2ES2"); } + public static final String getGLImplBaseClassName() { + if(isGL2()) { + return "com.sun.opengl.impl.gl2.GL2"; + } else if(isGL2ES12()) { + return "com.sun.opengl.impl.gl2es12.GL2ES12"; + } else if(isGLES1()) { + return "com.sun.opengl.impl.es1.GLES1"; + } else if(isGLES2()) { + return "com.sun.opengl.impl.es2.GLES2"; + } else { + throw new GLUnsupportedException("uncovered profile"); + } + } + } -- cgit v1.2.3