From fe0a2ad6f702aee71ea06f9da19ec9fd696d4095 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 21 Feb 2013 13:24:05 +0100 Subject: GLProfile: Adding convenient query for highest programmable core only GL profile As suggested @ http://forum.jogamp.org/How-to-force-core-profile-tp4028307.html However, one could always get a dedicated core profile via: - GLProfile.get(GLProfile.GLES2) - GLProfile.get(GLProfile.GL3) - GLProfile.get(GLProfile.GL4) .. etc --- src/jogl/classes/javax/media/opengl/GLProfile.java | 37 +++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index f916ab8b1..25bba1725 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -543,8 +543,20 @@ public class GLProfile { * * */ - public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER = new String[] { GL4bc, GL4, GL3bc, GL3, GL2, GLES2 }; + public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER = new String[] { GL4bc, GL4, GL3bc, GL3, GL2, GLES2 }; + /** + * Order of maximum programmable shader core only profiles + * + * + * + */ + public static final String[] GL_PROFILE_LIST_MAX_PROGSHADER_CORE = new String[] { GL4, GL3, GLES2 }; + /** Returns a default GLProfile object, reflecting the best for the running platform. * It selects the first of the set {@link GLProfile#GL_PROFILE_LIST_ALL} * and favors hardware acceleration. @@ -659,6 +671,29 @@ public class GLProfile { return get(GL_PROFILE_LIST_MAX_PROGSHADER, favorHardwareRasterizer); } + /** + * Returns the highest profile, implementing the programmable shader core pipeline only. + * It selects the first of the set: {@link GLProfile#GL_PROFILE_LIST_MAX_PROGSHADER_CORE} + * + * @throws GLException if no programmable core profile is available for the device. + * @see #GL_PROFILE_LIST_MAX_PROGSHADER_CORE + */ + public static GLProfile getMaxProgrammableCore(AbstractGraphicsDevice device, boolean favorHardwareRasterizer) + throws GLException + { + return get(device, GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer); + } + + /** Uses the default device + * @throws GLException if no programmable core profile is available for the default device. + * @see #GL_PROFILE_LIST_MAX_PROGSHADER_CORE + */ + public static GLProfile getMaxProgrammableCore(boolean favorHardwareRasterizer) + throws GLException + { + return get(GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer); + } + /** * Returns the GL2ES1 profile implementation, hence compatible w/ GL2ES1.
* It returns: -- cgit v1.2.3