diff options
author | Sven Gothel <[email protected]> | 2014-07-29 20:52:10 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-29 20:52:10 +0200 |
commit | 323fd68b6cce41de4980a909ef55273a98a8aad9 (patch) | |
tree | 0fd753ba87f1a9f1ad2978639d1321d925390945 /src/jogl/classes/jogamp/opengl | |
parent | 67444b99f42e5a6db282e8a7dbc0e633713d0d48 (diff) |
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.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java index a9848f899..c0ce6e8f9 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java @@ -36,6 +36,7 @@ import javax.media.opengl.GL; import javax.media.opengl.GL2ES2; import javax.media.opengl.GLArrayData; import javax.media.opengl.GLException; +import javax.media.opengl.GLProfile; import javax.media.opengl.fixedfunc.GLLightingFunc; import javax.media.opengl.fixedfunc.GLMatrixFunc; import javax.media.opengl.fixedfunc.GLPointerFunc; @@ -50,6 +51,7 @@ import com.jogamp.opengl.util.glsl.fixedfunc.ShaderSelectionMode; public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFunc { public static final int MAX_TEXTURE_UNITS = 8; + protected final GLProfile gl2es1GLProfile; protected FixedFuncPipeline fixedFunction; protected PMVMatrix pmvMatrix; protected boolean ownsPMVMatrix; @@ -61,6 +63,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun * @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline} */ public FixedFuncHook (final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) { + this.gl2es1GLProfile = GLProfile.createCustomGLProfile(GLProfile.GL2ES1, gl.getGLProfile()); this.gl = gl; if(null != pmvMatrix) { this.ownsPMVMatrix = false; @@ -81,6 +84,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun final Class<?> shaderRootClass, final String shaderSrcRoot, final String shaderBinRoot, final String vertexColorFile, final String vertexColorLightFile, final String fragmentColorFile, final String fragmentColorTextureFile) { + this.gl2es1GLProfile = GLProfile.createCustomGLProfile(GLProfile.GL2ES1, gl.getGLProfile()); this.gl = gl; if(null != pmvMatrix) { this.ownsPMVMatrix = false; @@ -110,6 +114,24 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun // // FixedFuncHookIf - hooks // + public final boolean isGL4core() { + return false; + } + public final boolean isGL3core() { + return false; + } + public final boolean isGLcore() { + return false; + } + public final boolean isGLES2Compatible() { + return false; + } + public final boolean isGLES3Compatible() { + return false; + } + public final GLProfile getGLProfile() { + return gl2es1GLProfile; + } public void glDrawArrays(final int mode, final int first, final int count) { fixedFunction.glDrawArrays(gl, mode, first, count); } |