diff options
author | Kenneth Russel <[email protected]> | 2008-08-02 23:46:03 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-08-02 23:46:03 +0000 |
commit | 6975077ab287a60b78132ede463da3cc63b2a4b1 (patch) | |
tree | 75977d038fc67e7b3a226acb6423216af554992d /src/classes | |
parent | 07a44e1d67b4f0ea2efb68c888cd8c6e1f7d2632 (diff) |
Cleaned up error messages printed from GLProfile selection
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1739 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes')
-rw-r--r-- | src/classes/javax/media/opengl/GLProfile.java | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/classes/javax/media/opengl/GLProfile.java b/src/classes/javax/media/opengl/GLProfile.java index 3dda6aff8..ff68a6d38 100644 --- a/src/classes/javax/media/opengl/GLProfile.java +++ b/src/classes/javax/media/opengl/GLProfile.java @@ -53,7 +53,7 @@ public class GLProfile { /** The OpenGL ES 2 (really, 2.0) profile */ public static final String GLES2 = "GLES2"; - /** The JVM/process wide choosen GL profile **/ + /** The JVM/process wide chosen GL profile **/ private static String profile = null; private static final void tryLibrary() @@ -71,8 +71,6 @@ public class GLProfile { } } } catch (Throwable e) { - System.out.println("Profile: "+profile+" not available."); - e.printStackTrace(); profile=null; } } @@ -83,9 +81,12 @@ public class GLProfile { if(null==GLProfile.profile) { GLProfile.profile = profile; tryLibrary(); + if (profile == null) { + throw new GLException("Profile " + profile + " not available"); + } } else { if(!GLProfile.profile.equals(profile)) { - throw new GLException("Choosen profile ("+profile+") doesn't match preset one: "+GLProfile.profile); + throw new GLException("Chosen profile ("+profile+") doesn't match preset one: "+GLProfile.profile); } } } @@ -94,7 +95,8 @@ public class GLProfile { throws GLException { for(int i=0; profile==null && i<profiles.length; i++) { - setProfile(profiles[i]); + profile = profiles[i]; + tryLibrary(); } if(null==profile) { StringBuffer msg = new StringBuffer(); @@ -114,9 +116,6 @@ public class GLProfile { */ public static synchronized final void setProfileGL2ES1() { setProfile(new String[] { GLES1, GL2ES12, GL2 }); - if(null==profile) { - throw new GLException("Profiles GLES1, GL2ES12 and GL2 not available"); - } } /** @@ -124,9 +123,6 @@ public class GLProfile { */ public static synchronized final void setProfileGL2ES2() { setProfile(new String[] { GLES2, GL2ES12, GL2 }); - if(null==profile) { - throw new GLException("Profiles GLES2, GL2ES12 and GL2 not available"); - } } /** @@ -134,9 +130,6 @@ public class GLProfile { */ public static synchronized final void setProfileGLAny() { setProfile(new String[] { GLES2, GLES1, GL2ES12, GL2 }); - if(null==profile) { - throw new GLException("Profiles GLES2, GLES1, GL2ES12 and GL2 not available"); - } } public static final String getProfile() { @@ -216,9 +209,7 @@ public class GLProfile { } else if(isGLES2()) { return "com.sun.opengl.impl.es2.GLES2"; } else { - throw new GLUnsupportedException("uncovered profile"); + throw new GLUnsupportedException("unsupported profile \"" + profile + "\""); } } - } - |