From 323fd68b6cce41de4980a909ef55273a98a8aad9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 29 Jul 2014 20:52:10 +0200 Subject: BuildComposablePipeline: Handle synthetic isGL* and getGL* more generic, allow FixedFunctionHook to properly determine it's identity BuildComposablePipeline: Handle synthetic isGL* and getGL* more generic, allow using a prologue hook as needed for FixedFunctionHook's 'isGL*core()', 'isGLES*Compatible()' and 'getGLProfile()' methods. The latter FixedFunctionHook take the emulated GL profile GL2ES1 into account, allowing JOGL code to assume only having GL2ES1 available. Otherwise methods like Texture.enable(..) would skip the glEnable(TEXTURE_2D) call and FixedFunctionHook could not enable it's usage. GLProfile received a 'public static GLProfile createCustomGLProfile(final String profile, final GLProfile profileImpl)' allowing utilities like FixedFunctionHook to create a generic profile. BuildComposablePipeline sorts the methods before emitting for better readability. --- src/jogl/classes/javax/media/opengl/GLProfile.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/javax/media/opengl/GLProfile.java') diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 324fdee92..5c70ec675 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -1529,7 +1529,7 @@ public class GLProfile { @Override public String toString() { - return "GLProfile[" + getName() + "/" + getImplName() + "."+(this.isHardwareRasterizer?"hw":"sw")+"]"; + return "GLProfile[" + getName() + "/" + getImplName() + "."+(this.isHardwareRasterizer?"hw":"sw")+(isCustom?".custom":"")+"]"; } private static /*final*/ boolean isAWTAvailable; @@ -1952,13 +1952,13 @@ public class GLProfile { if( null != profileImpl ) { final GLProfile glProfile; if( profile.equals( profileImpl ) ) { - glProfile = new GLProfile(profile, null, isHardwareRasterizer[0]); + glProfile = new GLProfile(profile, null, isHardwareRasterizer[0], false /* custom */); } else { final GLProfile _mglp = _mappedProfiles.get( profileImpl ); if( null == _mglp ) { throw new InternalError("XXX0 profile["+i+"]: "+profile+" -> profileImpl "+profileImpl+" !!! not mapped "); } - glProfile = new GLProfile(profile, _mglp, isHardwareRasterizer[0]); + glProfile = new GLProfile(profile, _mglp, isHardwareRasterizer[0], false /* custom */); } _mappedProfiles.put(profile, glProfile); if (DEBUG) { @@ -2180,13 +2180,19 @@ public class GLProfile { } } - private GLProfile(final String profile, final GLProfile profileImpl, final boolean isHardwareRasterizer) { + private GLProfile(final String profile, final GLProfile profileImpl, final boolean isHardwareRasterizer, final boolean isCustom) { this.profile = profile; this.profileImpl = profileImpl; this.isHardwareRasterizer = isHardwareRasterizer; + this.isCustom = isCustom; + } + + public static GLProfile createCustomGLProfile(final String profile, final GLProfile profileImpl) { + return new GLProfile(profile, profileImpl, profileImpl.isHardwareRasterizer, true); } private final GLProfile profileImpl; private final String profile; private final boolean isHardwareRasterizer; + private final boolean isCustom; } -- cgit v1.2.3