From 7ac7b81d5cf10187aca8c1df85d1cf44fef299d3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 22 Apr 2011 05:33:07 +0200 Subject: Fix GLProfile: Order of profiles Hi -> Low Ensure returning the highest profile always: all old: GL4bc, GL3bc, GL2, GL2GL3, GL4, GL3, GL2ES2, GLES2, GL2ES1, GLES1 all new: GL4bc, GL3bc, GL2, GL4, GL3, GL2GL3, GLES2, GL2ES2, GLES1, GL2ES1 --- src/jogl/classes/javax/media/opengl/GLProfile.java | 106 ++++++++++----------- 1 file changed, 52 insertions(+), 54 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl') diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 17313f770..1921d117b 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -353,22 +353,23 @@ public class GLProfile { * All GL Profiles in the order of default detection. * Desktop compatibility profiles (the one with fixed function pipeline) comes first * from highest to lowest version. + *

This includes the generic subset profiles GL2GL3, GL2ES2 and GL2ES1.

* * * */ - public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL4bc, GL3bc, GL2, GL2GL3, GL4, GL3, GL2ES2, GLES2, GL2ES1, GLES1 }; + public static final String[] GL_PROFILE_LIST_ALL = new String[] { GL4bc, GL3bc, GL2, GL4, GL3, GL2GL3, GLES2, GL2ES2, GLES1, GL2ES1 }; /** * Order of maximum profiles. @@ -379,15 +380,12 @@ public class GLProfile { *
  • GL3bc *
  • GL3 *
  • GL2 - *
  • GL2GL3 - *
  • GL2ES2 *
  • GLES2 - *
  • GL2ES1 *
  • GLES1 * * */ - public static final String[] GL_PROFILE_LIST_MAX = new String[] { GL4bc, GL4, GL3bc, GL3, GL2, GL2GL3, GL2ES2, GLES2, GL2ES1, GLES1 }; + public static final String[] GL_PROFILE_LIST_MAX = new String[] { GL4bc, GL4, GL3bc, GL3, GL2, GLES2, GLES1 }; /** * Order of minimum original desktop profiles. @@ -410,56 +408,40 @@ public class GLProfile { *
  • GL4bc *
  • GL3bc *
  • GL2 - *
  • GL2ES1 *
  • GLES1 * * */ - public static final String[] GL_PROFILE_LIST_MAX_FIXEDFUNC = new String[] { GL4bc, GL3bc, GL2, GL2ES1, GLES1 }; + public static final String[] GL_PROFILE_LIST_MAX_FIXEDFUNC = new String[] { GL4bc, GL3bc, GL2, GLES1 }; /** * Order of maximum programmable shader profiles * * * */ - public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER = new String[] { GL4bc, GL4, GL3bc, GL3, GL2, GL2ES2, GLES2 }; + public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER = new String[] { GL4bc, GL4, GL3bc, GL3, GL2, GLES2 }; /** * All GL2ES2 Profiles in the order of default detection. * - * - * + * @see #GL_PROFILE_LIST_MAX_PROGSHADER */ - public static final String[] GL_PROFILE_LIST_GL2ES2 = new String[] { GL2ES2, GL4, GL3, GL2, GLES2 }; + public static final String[] GL_PROFILE_LIST_GL2ES2 = GL_PROFILE_LIST_MAX_PROGSHADER; /** * All GL2ES1 Profiles in the order of default detection. * - * - * + * @see #GL_PROFILE_LIST_MAX_FIXEDFUNC */ - public static final String[] GL_PROFILE_LIST_GL2ES1 = new String[] { GL2ES1, GL4bc, GL3bc, GL2, GLES1 }; + public static final String[] GL_PROFILE_LIST_GL2ES1 = GL_PROFILE_LIST_MAX_FIXEDFUNC; /** * All GLES Profiles in the order of default detection. @@ -568,9 +550,9 @@ public class GLProfile { } /** - * Returns a profile, implementing the interface GL2ES1. - * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES1} - * + * Returns an available GL2ES1 compatible profile. + * It returns the first available of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES1}. + * * @throws GLException if no implementation for the given profile is found. * @see #GL_PROFILE_LIST_GL2ES1 */ @@ -580,7 +562,13 @@ public class GLProfile { return get(device, GL_PROFILE_LIST_GL2ES1); } - /** Uses the default device */ + /** + * Returns an available GL2ES1 compatible profile. + * It returns the first available of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES1}. + * + * @throws GLException if no implementation for the given profile is found. + * @see #GL_PROFILE_LIST_GL2ES1 + */ public static GLProfile getGL2ES1() throws GLException { @@ -588,8 +576,8 @@ public class GLProfile { } /** - * Returns a profile, implementing the interface GL2ES2. - * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES2} + * Returns an available GL2ES2 compatible profile. + * It returns the first available of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES2}. * * @throws GLException if no implementation for the given profile is found. * @see #GL_PROFILE_LIST_GL2ES2 @@ -600,7 +588,13 @@ public class GLProfile { return get(device, GL_PROFILE_LIST_GL2ES2); } - /** Uses the default device */ + /** + * Returns an available GL2ES2 compatible profile + * It returns the first available of the set: {@link GLProfile#GL_PROFILE_LIST_GL2ES2}. + * + * @throws GLException if no implementation for the given profile is found. + * @see #GL_PROFILE_LIST_GL2ES2 + */ public static GLProfile getGL2ES2() throws GLException { @@ -1458,7 +1452,7 @@ public class GLProfile { System.err.println("GLProfile.init map "+device.getConnection()+", desktopCtxUndef "+desktopCtxUndef+", eglCtxUndef "+eglCtxUndef); } GLProfile defaultGLProfile = null; - HashMap/**/ _mappedProfiles = new HashMap(GL_PROFILE_LIST_ALL.length + 1 /* default */); + HashMap _mappedProfiles = new HashMap(GL_PROFILE_LIST_ALL.length + 1 /* default */); for(int i=0; i