diff options
author | Sven Gothel <[email protected]> | 2012-04-16 01:38:49 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-04-16 01:38:49 +0200 |
commit | 62e5686fb583ad991d5811baf242d40d21952e27 (patch) | |
tree | 6bf20b4f0422c1c6e5cdf7843d9ef4e03e08d83b /src/jogl/classes/jogamp/opengl | |
parent | 131c40a80427d5e35824ad41da375edd4792fb60 (diff) |
API Change ShaderCode/ShaderUtil: Enable optional mutable shader source / generalize shader source storage type to CharSequence[]
Benefits:
- Allows code injection and general shader source editing (before compilation)
- Uses mutable StringBuilder only if editing is intended, hence reduces memory footprint
and String conversion at compilation in such case.
- ShaderCode.create(..) factory methods add nw attribute 'mutableStringBuilder'
if true method returns a mutable StringBuilder instance
which can be edited later on at the costs of a String conversion when passing to
'glShaderSource(int, int, String[], IntBuffer)'.
If <code>false</code> method returns an immutable <code>String</code> instance,
which can be passed to {@link GL2ES2#glShaderSource(int, int, String[], IntBuffer)}
at no additional costs.
- New 'edit' methods in ShaderCode: '
- int insertShaderSource(int shaderIdx, String tag, int fromIndex, CharSequence data);
- int insertShaderSource(int shaderIdx, int position, CharSequence data);
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java index 41a694e9e..bfe2e13c2 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java @@ -409,17 +409,17 @@ public class FixedFuncPipeline { this.shaderState.setVerbose(verbose); ShaderCode vertexColor, vertexColorLight, fragmentColor, fragmentColorTexture; - vertexColor = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, 1, shaderRootClass, - shaderSrcRoot, shaderBinRoot, vertexColorFile); + vertexColor = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, shaderRootClass, shaderSrcRoot, + shaderBinRoot, vertexColorFile, false); - vertexColorLight = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, 1, shaderRootClass, - shaderSrcRoot, shaderBinRoot, vertexColorLightFile); + vertexColorLight = ShaderCode.create( gl, gl.GL_VERTEX_SHADER, shaderRootClass, shaderSrcRoot, + shaderBinRoot, vertexColorLightFile, false); - fragmentColor = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, 1, shaderRootClass, - shaderSrcRoot, shaderBinRoot, fragmentColorFile); + fragmentColor = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, shaderRootClass, shaderSrcRoot, + shaderBinRoot, fragmentColorFile, false); - fragmentColorTexture = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, 1, shaderRootClass, - shaderSrcRoot, shaderBinRoot, fragmentColorTextureFile); + fragmentColorTexture = ShaderCode.create( gl, gl.GL_FRAGMENT_SHADER, shaderRootClass, shaderSrcRoot, + shaderBinRoot, fragmentColorTextureFile, false); shaderProgramColor = new ShaderProgram(); shaderProgramColor.add(vertexColor); |