diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
commit | 556d92b63555a085b25e32b1cd55afce24edd07a (patch) | |
tree | 6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/jogamp/opengl/util/glsl | |
parent | a90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/glsl')
6 files changed, 164 insertions, 163 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java index e9fb91086..5a78f514d 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java @@ -45,22 +45,22 @@ import com.jogamp.opengl.util.glsl.ShaderState; */ public class GLSLArrayHandler extends GLVBOArrayHandler { - public GLSLArrayHandler(GLArrayDataEditable ad) { + public GLSLArrayHandler(final GLArrayDataEditable ad) { super(ad); } @Override - public final void setSubArrayVBOName(int vboName) { + public final void setSubArrayVBOName(final int vboName) { throw new UnsupportedOperationException(); } @Override - public final void addSubHandler(GLArrayHandlerFlat handler) { + public final void addSubHandler(final GLArrayHandlerFlat handler) { throw new UnsupportedOperationException(); } @Override - public final void enableState(GL gl, boolean enable, Object ext) { + public final void enableState(final GL gl, final boolean enable, final Object ext) { final GL2ES2 glsl = gl.getGL2ES2(); if( null != ext ) { enableShaderState(glsl, enable, (ShaderState)ext); @@ -71,7 +71,7 @@ public class GLSLArrayHandler extends GLVBOArrayHandler { private final int[] tempI = new int[1]; - private final void enableShaderState(GL2ES2 glsl, boolean enable, ShaderState st) { + private final void enableShaderState(final GL2ES2 glsl, final boolean enable, final ShaderState st) { if(enable) { /* * This would be the non optimized code path: @@ -118,7 +118,7 @@ public class GLSLArrayHandler extends GLVBOArrayHandler { } } - private final void enableSimple(GL2ES2 glsl, boolean enable) { + private final void enableSimple(final GL2ES2 glsl, final boolean enable) { final int location = ad.getLocation(); if( 0 > location ) { return; diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java index 34a381d7d..85fcabdd9 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java @@ -41,9 +41,9 @@ import com.jogamp.opengl.util.glsl.ShaderState; * separately and interleaves many arrays. */ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat { - private GLArrayDataWrapper ad; + private final GLArrayDataWrapper ad; - public GLSLArrayHandlerFlat(GLArrayDataWrapper ad) { + public GLSLArrayHandlerFlat(final GLArrayDataWrapper ad) { this.ad = ad; } @@ -53,7 +53,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat { } @Override - public final void syncData(GL gl, Object ext) { + public final void syncData(final GL gl, final Object ext) { final GL2ES2 glsl = gl.getGL2ES2(); if( null != ext ) { ((ShaderState)ext).vertexAttribPointer(glsl, ad); @@ -80,7 +80,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat { } @Override - public final void enableState(GL gl, boolean enable, Object ext) { + public final void enableState(final GL gl, final boolean enable, final Object ext) { final GL2ES2 glsl = gl.getGL2ES2(); if( null != ext ) { final ShaderState st = (ShaderState)ext; diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java index e153082e0..0169b0747 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java @@ -45,30 +45,30 @@ import com.jogamp.opengl.util.GLArrayDataEditable; public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler { private final List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>(); - public GLSLArrayHandlerInterleaved(GLArrayDataEditable ad) { + public GLSLArrayHandlerInterleaved(final GLArrayDataEditable ad) { super(ad); } @Override - public final void setSubArrayVBOName(int vboName) { + public final void setSubArrayVBOName(final int vboName) { for(int i=0; i<subArrays.size(); i++) { subArrays.get(i).getData().setVBOName(vboName); } } @Override - public final void addSubHandler(GLArrayHandlerFlat handler) { + public final void addSubHandler(final GLArrayHandlerFlat handler) { subArrays.add(handler); } - private final void syncSubData(GL gl, Object ext) { + private final void syncSubData(final GL gl, final Object ext) { for(int i=0; i<subArrays.size(); i++) { subArrays.get(i).syncData(gl, ext); } } @Override - public final void enableState(GL gl, boolean enable, Object ext) { + public final void enableState(final GL gl, final boolean enable, final Object ext) { if(enable) { if(!ad.isVBO()) { throw new InternalError("Interleaved handle is not VBO: "+ad); diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java index 09da8c9ee..d5d0020c5 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java @@ -52,7 +52,7 @@ public class GLSLTextureRaster { private GLUniformData activeTexUniform; private GLArrayDataServer interleavedVBO; - public GLSLTextureRaster(int textureUnit, boolean textureVertFlipped) { + public GLSLTextureRaster(final int textureUnit, final boolean textureVertFlipped) { this.textureVertFlipped = textureVertFlipped; this.textureUnit = textureUnit; } @@ -63,7 +63,7 @@ public class GLSLTextureRaster { static final String shaderSrcPath = "../../shader"; static final String shaderBinPath = "../../shader/bin"; - public void init(GL2ES2 gl) { + public void init(final GL2ES2 gl) { // Create & Compile the shader objects final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), shaderSrcPath, shaderBinPath, shaderBasename, true); @@ -83,9 +83,9 @@ public class GLSLTextureRaster { // setup mgl_PMVMatrix pmvMatrix = new PMVMatrix(); - pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION); + pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION); pmvMatrix.glLoadIdentity(); - pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW); + pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); pmvMatrix.glLoadIdentity(); pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv if( pmvMatrixUniform.setLocation(gl, sp.program()) < 0 ) { @@ -128,7 +128,7 @@ public class GLSLTextureRaster { sp.useProgram(gl, false); } - public void reshape(GL2ES2 gl, int x, int y, int width, int height) { + public void reshape(final GL2ES2 gl, final int x, final int y, final int width, final int height) { if(null != sp) { pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION); pmvMatrix.glLoadIdentity(); @@ -143,7 +143,7 @@ public class GLSLTextureRaster { } } - public void dispose(GL2ES2 gl) { + public void dispose(final GL2ES2 gl) { if(null != pmvMatrixUniform) { pmvMatrixUniform = null; } @@ -158,7 +158,7 @@ public class GLSLTextureRaster { } } - public void display(GL2ES2 gl) { + public void display(final GL2ES2 gl) { if(null != sp) { sp.useProgram(gl, true); interleavedVBO.enableBuffer(gl, true); 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 ff8006cf8..a9848f899 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java @@ -60,7 +60,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun * @param mode TODO * @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline} */ - public FixedFuncHook (GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) { + public FixedFuncHook (final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) { this.gl = gl; if(null != pmvMatrix) { this.ownsPMVMatrix = false; @@ -77,10 +77,10 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun * @param mode TODO * @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline} */ - public FixedFuncHook(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix, - Class<?> shaderRootClass, String shaderSrcRoot, String shaderBinRoot, - String vertexColorFile, String vertexColorLightFile, - String fragmentColorFile, String fragmentColorTextureFile) { + public FixedFuncHook(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix, + final Class<?> shaderRootClass, final String shaderSrcRoot, final String shaderBinRoot, + final String vertexColorFile, final String vertexColorLightFile, + final String fragmentColorFile, final String fragmentColorTextureFile) { this.gl = gl; if(null != pmvMatrix) { this.ownsPMVMatrix = false; @@ -96,7 +96,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun public boolean verbose() { return fixedFunction.verbose(); } - public void setVerbose(boolean v) { fixedFunction.setVerbose(v); } + public void setVerbose(final boolean v) { fixedFunction.setVerbose(v); } public void destroy() { fixedFunction.destroy(gl); @@ -110,32 +110,32 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun // // FixedFuncHookIf - hooks // - public void glDrawArrays(int mode, int first, int count) { + public void glDrawArrays(final int mode, final int first, final int count) { fixedFunction.glDrawArrays(gl, mode, first, count); } - public void glDrawElements(int mode, int count, int type, java.nio.Buffer indices) { + public void glDrawElements(final int mode, final int count, final int type, final java.nio.Buffer indices) { fixedFunction.glDrawElements(gl, mode, count, type, indices); } - public void glDrawElements(int mode, int count, int type, long indices_buffer_offset) { + public void glDrawElements(final int mode, final int count, final int type, final long indices_buffer_offset) { fixedFunction.glDrawElements(gl, mode, count, type, indices_buffer_offset); } - public void glActiveTexture(int texture) { + public void glActiveTexture(final int texture) { fixedFunction.glActiveTexture(texture); gl.glActiveTexture(texture); } - public void glEnable(int cap) { + public void glEnable(final int cap) { if(fixedFunction.glEnable(cap, true)) { gl.glEnable(cap); } } - public void glDisable(int cap) { + public void glDisable(final int cap) { if(fixedFunction.glEnable(cap, false)) { gl.glDisable(cap); } } @Override - public void glGetFloatv(int pname, java.nio.FloatBuffer params) { + public void glGetFloatv(final int pname, final java.nio.FloatBuffer params) { if(PMVMatrix.isMatrixGetName(pname)) { pmvMatrix.glGetFloatv(pname, params); return; @@ -143,7 +143,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun gl.glGetFloatv(pname, params); } @Override - public void glGetFloatv(int pname, float[] params, int params_offset) { + public void glGetFloatv(final int pname, final float[] params, final int params_offset) { if(PMVMatrix.isMatrixGetName(pname)) { pmvMatrix.glGetFloatv(pname, params, params_offset); return; @@ -151,7 +151,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun gl.glGetFloatv(pname, params, params_offset); } @Override - public void glGetIntegerv(int pname, IntBuffer params) { + public void glGetIntegerv(final int pname, final IntBuffer params) { if(PMVMatrix.isMatrixGetName(pname)) { pmvMatrix.glGetIntegerv(pname, params); return; @@ -159,7 +159,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun gl.glGetIntegerv(pname, params); } @Override - public void glGetIntegerv(int pname, int[] params, int params_offset) { + public void glGetIntegerv(final int pname, final int[] params, final int params_offset) { if(PMVMatrix.isMatrixGetName(pname)) { pmvMatrix.glGetIntegerv(pname, params, params_offset); return; @@ -167,21 +167,21 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun gl.glGetIntegerv(pname, params, params_offset); } - public void glTexEnvi(int target, int pname, int value) { + public void glTexEnvi(final int target, final int pname, final int value) { fixedFunction.glTexEnvi(target, pname, value); } - public void glGetTexEnviv(int target, int pname, IntBuffer params) { + public void glGetTexEnviv(final int target, final int pname, final IntBuffer params) { fixedFunction.glGetTexEnviv(target, pname, params); } - public void glGetTexEnviv(int target, int pname, int[] params, int params_offset) { + public void glGetTexEnviv(final int target, final int pname, final int[] params, final int params_offset) { fixedFunction.glGetTexEnviv(target, pname, params, params_offset); } - public void glBindTexture(int target, int texture) { + public void glBindTexture(final int target, final int texture) { fixedFunction.glBindTexture(target, texture); gl.glBindTexture(target, texture); } - public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, - int format, int type, Buffer pixels) { + public void glTexImage2D(final int target, final int level, int internalformat, final int width, final int height, final int border, + final int format, final int type, final Buffer pixels) { // align internalformat w/ format, an ES2 requirement switch(internalformat) { case 3: internalformat= ( GL.GL_RGBA == format ) ? GL.GL_RGBA : GL.GL_RGB; break; @@ -190,8 +190,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun fixedFunction.glTexImage2D(target, /* level, */ internalformat, /*width, height, border, */ format /*, type, pixels*/); gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } - public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, - int format, int type, long pixels_buffer_offset) { + public void glTexImage2D(final int target, final int level, int internalformat, final int width, final int height, final int border, + final int format, final int type, final long pixels_buffer_offset) { // align internalformat w/ format, an ES2 requirement switch(internalformat) { case 3: internalformat= ( GL.GL_RGBA == format ) ? GL.GL_RGBA : GL.GL_RGB; break; @@ -201,16 +201,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels_buffer_offset); } - public void glPointSize(float size) { + public void glPointSize(final float size) { fixedFunction.glPointSize(size); } - public void glPointParameterf(int pname, float param) { + public void glPointParameterf(final int pname, final float param) { fixedFunction.glPointParameterf(pname, param); } - public void glPointParameterfv(int pname, float[] params, int params_offset) { + public void glPointParameterfv(final int pname, final float[] params, final int params_offset) { fixedFunction.glPointParameterfv(pname, params, params_offset); } - public void glPointParameterfv(int pname, java.nio.FloatBuffer params) { + public void glPointParameterfv(final int pname, final java.nio.FloatBuffer params) { fixedFunction.glPointParameterfv(pname, params); } @@ -221,16 +221,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun return pmvMatrix.glGetMatrixMode(); } @Override - public void glMatrixMode(int mode) { + public void glMatrixMode(final int mode) { pmvMatrix.glMatrixMode(mode); } @Override - public void glLoadMatrixf(java.nio.FloatBuffer m) { + public void glLoadMatrixf(final java.nio.FloatBuffer m) { pmvMatrix.glLoadMatrixf(m); } @Override - public void glLoadMatrixf(float[] m, int m_offset) { - glLoadMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset)); + public void glLoadMatrixf(final float[] m, final int m_offset) { + glLoadMatrixf(Buffers.newDirectFloatBuffer(m, m_offset)); } @Override public void glPopMatrix() { @@ -245,37 +245,37 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun pmvMatrix.glLoadIdentity(); } @Override - public void glMultMatrixf(java.nio.FloatBuffer m) { + public void glMultMatrixf(final java.nio.FloatBuffer m) { pmvMatrix.glMultMatrixf(m); } @Override - public void glMultMatrixf(float[] m, int m_offset) { - glMultMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset)); + public void glMultMatrixf(final float[] m, final int m_offset) { + glMultMatrixf(Buffers.newDirectFloatBuffer(m, m_offset)); } @Override - public void glTranslatef(float x, float y, float z) { + public void glTranslatef(final float x, final float y, final float z) { pmvMatrix.glTranslatef(x, y, z); } @Override - public void glRotatef(float angdeg, float x, float y, float z) { + public void glRotatef(final float angdeg, final float x, final float y, final float z) { pmvMatrix.glRotatef(angdeg, x, y, z); } @Override - public void glScalef(float x, float y, float z) { + public void glScalef(final float x, final float y, final float z) { pmvMatrix.glScalef(x, y, z); } - public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) { + public void glOrtho(final double left, final double right, final double bottom, final double top, final double near_val, final double far_val) { glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val); } @Override - public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) { + public void glOrthof(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) { pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar); } - public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) { + public void glFrustum(final double left, final double right, final double bottom, final double top, final double zNear, final double zFar) { glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar); } @Override - public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) { + public void glFrustumf(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) { pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar); } @@ -283,45 +283,45 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun // LightingIf // @Override - public void glColor4f(float red, float green, float blue, float alpha) { + public void glColor4f(final float red, final float green, final float blue, final float alpha) { fixedFunction.glColor4f(gl, red, green, blue, alpha); } - public void glColor4ub(byte red, byte green, byte blue, byte alpha) { + public void glColor4ub(final byte red, final byte green, final byte blue, final byte alpha) { glColor4f(ValueConv.byte_to_float(red, false), ValueConv.byte_to_float(green, false), ValueConv.byte_to_float(blue, false), ValueConv.byte_to_float(alpha, false) ); } @Override - public void glLightfv(int light, int pname, java.nio.FloatBuffer params) { + public void glLightfv(final int light, final int pname, final java.nio.FloatBuffer params) { fixedFunction.glLightfv(gl, light, pname, params); } @Override - public void glLightfv(int light, int pname, float[] params, int params_offset) { - glLightfv(light, pname, GLBuffers.newDirectFloatBuffer(params, params_offset)); + public void glLightfv(final int light, final int pname, final float[] params, final int params_offset) { + glLightfv(light, pname, Buffers.newDirectFloatBuffer(params, params_offset)); } @Override - public void glMaterialfv(int face, int pname, java.nio.FloatBuffer params) { + public void glMaterialfv(final int face, final int pname, final java.nio.FloatBuffer params) { fixedFunction.glMaterialfv(gl, face, pname, params); } @Override - public void glMaterialfv(int face, int pname, float[] params, int params_offset) { - glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(params, params_offset)); + public void glMaterialfv(final int face, final int pname, final float[] params, final int params_offset) { + glMaterialfv(face, pname, Buffers.newDirectFloatBuffer(params, params_offset)); } @Override - public void glMaterialf(int face, int pname, float param) { - glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(new float[] { param })); + public void glMaterialf(final int face, final int pname, final float param) { + glMaterialfv(face, pname, Buffers.newDirectFloatBuffer(new float[] { param })); } // // Misc Simple States // @Override - public void glShadeModel(int mode) { + public void glShadeModel(final int mode) { fixedFunction.glShadeModel(gl, mode); } - public void glAlphaFunc(int func, float ref) { + public void glAlphaFunc(final int func, final float ref) { fixedFunction.glAlphaFunc(func, ref); } @@ -334,20 +334,20 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun // // PointerIf // - public void glClientActiveTexture(int textureUnit) { + public void glClientActiveTexture(final int textureUnit) { fixedFunction.glClientActiveTexture(textureUnit); } @Override - public void glEnableClientState(int glArrayIndex) { + public void glEnableClientState(final int glArrayIndex) { fixedFunction.glEnableClientState(gl, glArrayIndex); } @Override - public void glDisableClientState(int glArrayIndex) { + public void glDisableClientState(final int glArrayIndex) { fixedFunction.glDisableClientState(gl, glArrayIndex); } @Override - public void glVertexPointer(GLArrayData array) { + public void glVertexPointer(final GLArrayData array) { if(array.isVBO()) { if(!gl.isVBOArrayBound()) { throw new GLException("VBO array is not enabled: "+array); @@ -364,13 +364,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun } @Override - public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) { + public void glVertexPointer(final int size, final int type, final int stride, final java.nio.Buffer pointer) { glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER)); } @Override - public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) { - int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER); + public void glVertexPointer(final int size, final int type, final int stride, final long pointer_buffer_offset) { + final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER); if(vboName==0) { throw new GLException("no GL_ARRAY_BUFFER VBO bound"); } @@ -379,7 +379,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun } @Override - public void glColorPointer(GLArrayData array) { + public void glColorPointer(final GLArrayData array) { if(array.isVBO()) { if(!gl.isVBOArrayBound()) { throw new GLException("VBO array is not enabled: "+array); @@ -395,13 +395,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun fixedFunction.glColorPointer(gl, array); } @Override - public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) { + public void glColorPointer(final int size, final int type, final int stride, final java.nio.Buffer pointer) { glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER)); } @Override - public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) { - int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER); + public void glColorPointer(final int size, final int type, final int stride, final long pointer_buffer_offset) { + final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER); if(vboName==0) { throw new GLException("no GL_ARRAY_BUFFER VBO bound"); } @@ -410,7 +410,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun } @Override - public void glNormalPointer(GLArrayData array) { + public void glNormalPointer(final GLArrayData array) { if(array.getComponentCount()!=3) { throw new GLException("Only 3 components per normal allowed"); } @@ -429,13 +429,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun fixedFunction.glNormalPointer(gl, array); } @Override - public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) { + public void glNormalPointer(final int type, final int stride, final java.nio.Buffer pointer) { glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride, pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER)); } @Override - public void glNormalPointer(int type, int stride, long pointer_buffer_offset) { - int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER); + public void glNormalPointer(final int type, final int stride, final long pointer_buffer_offset) { + final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER); if(vboName==0) { throw new GLException("no GL_ARRAY_BUFFER VBO bound"); } @@ -444,7 +444,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun } @Override - public void glTexCoordPointer(GLArrayData array) { + public void glTexCoordPointer(final GLArrayData array) { if(array.isVBO()) { if(!gl.isVBOArrayBound()) { throw new GLException("VBO array is not enabled: "+array); @@ -460,14 +460,14 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun fixedFunction.glTexCoordPointer(gl, array); } @Override - public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) { + public void glTexCoordPointer(final int size, final int type, final int stride, final java.nio.Buffer pointer) { glTexCoordPointer( GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride, pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER)); } @Override - public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) { - int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER); + public void glTexCoordPointer(final int size, final int type, final int stride, final long pointer_buffer_offset) { + final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER); if(vboName==0) { throw new GLException("no GL_ARRAY_BUFFER VBO bound"); } @@ -478,7 +478,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun @Override public final String toString() { - StringBuilder buf = new StringBuilder(); + final StringBuilder buf = new StringBuilder(); buf.append(getClass().getName()+" ("); if(null!=pmvMatrix) { buf.append(", matrixDirty: "+ (0 != pmvMatrix.getModifiedBits(false))); 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 42269588d..c65ed084d 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java @@ -52,6 +52,7 @@ import jogamp.opengl.Debug; import com.jogamp.common.nio.Buffers; import com.jogamp.common.util.IntIntHashMap; +import com.jogamp.common.util.PropertyAccess; import com.jogamp.opengl.util.PMVMatrix; import com.jogamp.opengl.util.glsl.ShaderCode; import com.jogamp.opengl.util.glsl.ShaderProgram; @@ -71,14 +72,14 @@ public class FixedFuncPipeline { static { Debug.initSingleton(); - DEBUG = Debug.isPropertyDefined("jogl.debug.FixedFuncPipeline", true); + DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.FixedFuncPipeline", true); } /** The maximum texture units which could be used, depending on {@link ShaderSelectionMode}. */ public static final int MAX_TEXTURE_UNITS = 8; public static final int MAX_LIGHTS = 8; - public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) { + public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) { shaderRootClass = FixedFuncPipeline.class; shaderSrcRoot = shaderSrcRootDef; shaderBinRoot = shaderBinRootDef; @@ -88,11 +89,11 @@ public class FixedFuncPipeline { fragmentColorTextureFile = fragmentColorTextureFileDef; init(gl, mode, pmvMatrix); } - public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix, - Class<?> shaderRootClass, String shaderSrcRoot, - String shaderBinRoot, - String vertexColorFile, String vertexColorLightFile, - String fragmentColorFile, String fragmentColorTextureFile) { + public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix, + final Class<?> shaderRootClass, final String shaderSrcRoot, + final String shaderBinRoot, + final String vertexColorFile, final String vertexColorLightFile, + final String fragmentColorFile, final String fragmentColorTextureFile) { this.shaderRootClass = shaderRootClass; this.shaderSrcRoot = shaderSrcRoot; this.shaderBinRoot = shaderBinRoot; @@ -104,12 +105,12 @@ public class FixedFuncPipeline { } public ShaderSelectionMode getShaderSelectionMode() { return requestedShaderSelectionMode; } - public void setShaderSelectionMode(ShaderSelectionMode mode) { requestedShaderSelectionMode=mode; } + public void setShaderSelectionMode(final ShaderSelectionMode mode) { requestedShaderSelectionMode=mode; } public ShaderSelectionMode getCurrentShaderSelectionMode() { return currentShaderSelectionMode; } public boolean verbose() { return verbose; } - public void setVerbose(boolean v) { verbose = DEBUG || v; } + public void setVerbose(final boolean v) { verbose = DEBUG || v; } public boolean isValid() { return shaderState.linked(); @@ -123,7 +124,7 @@ public class FixedFuncPipeline { return activeTextureUnit; } - public void destroy(GL2ES2 gl) { + public void destroy(final GL2ES2 gl) { if(null != shaderProgramColor) { shaderProgramColor.release(gl, true); } @@ -148,7 +149,7 @@ public class FixedFuncPipeline { // // Simple Globals // - public void glColor4f(GL2ES2 gl, float red, float green, float blue, float alpha) { + public void glColor4f(final GL2ES2 gl, final float red, final float green, final float blue, final float alpha) { colorStatic.put(0, red); colorStatic.put(1, green); colorStatic.put(2, blue); @@ -168,15 +169,15 @@ public class FixedFuncPipeline { // Arrays / States // - public void glEnableClientState(GL2ES2 gl, int glArrayIndex) { + public void glEnableClientState(final GL2ES2 gl, final int glArrayIndex) { glToggleClientState(gl, glArrayIndex, true); } - public void glDisableClientState(GL2ES2 gl, int glArrayIndex) { + public void glDisableClientState(final GL2ES2 gl, final int glArrayIndex) { glToggleClientState(gl, glArrayIndex, false); } - private void glToggleClientState(GL2ES2 gl, int glArrayIndex, boolean enable) { + private void glToggleClientState(final GL2ES2 gl, final int glArrayIndex, final boolean enable) { final String arrayName = GLPointerFuncUtil.getPredefinedArrayIndexName(glArrayIndex, clientActiveTextureUnit); if(null == arrayName) { throw new GLException("arrayIndex "+toHexString(glArrayIndex)+" unknown"); @@ -203,17 +204,17 @@ public class FixedFuncPipeline { } } - public void glVertexPointer(GL2ES2 gl, GLArrayData data) { + public void glVertexPointer(final GL2ES2 gl, final GLArrayData data) { shaderState.useProgram(gl, true); shaderState.vertexAttribPointer(gl, data); } - public void glColorPointer(GL2ES2 gl, GLArrayData data) { + public void glColorPointer(final GL2ES2 gl, final GLArrayData data) { shaderState.useProgram(gl, true); shaderState.vertexAttribPointer(gl, data); } - public void glNormalPointer(GL2ES2 gl, GLArrayData data) { + public void glNormalPointer(final GL2ES2 gl, final GLArrayData data) { shaderState.useProgram(gl, true); shaderState.vertexAttribPointer(gl, data); } @@ -223,7 +224,7 @@ public class FixedFuncPipeline { // /** Enables/Disables the named texture unit (if changed), returns previous state */ - private boolean glEnableTexture(boolean enable, int unit) { + private boolean glEnableTexture(final boolean enable, final int unit) { final boolean isEnabled = 0 != ( textureEnabledBits & ( 1 << activeTextureUnit ) ); if( isEnabled != enable ) { if(enable) { @@ -256,7 +257,7 @@ public class FixedFuncPipeline { } } - public void glTexCoordPointer(GL2ES2 gl, GLArrayData data) { + public void glTexCoordPointer(final GL2ES2 gl, final GLArrayData data) { if( GLPointerFunc.GL_TEXTURE_COORD_ARRAY != data.getIndex() ) { throw new GLException("Invalid GLArrayData Index "+toHexString(data.getIndex())+", "+data); } @@ -265,7 +266,7 @@ public class FixedFuncPipeline { shaderState.vertexAttribPointer(gl, data); } - public void glBindTexture(int target, int texture) { + public void glBindTexture(final int target, final int texture) { if(GL.GL_TEXTURE_2D == target) { if( texture != boundTextureObject[activeTextureUnit] ) { boundTextureObject[activeTextureUnit] = texture; @@ -276,8 +277,8 @@ public class FixedFuncPipeline { } } - public void glTexImage2D(int target, /* int level, */ int internalformat, /*, int width, int height, int border, */ - int format /*, int type, Buffer pixels */) { + public void glTexImage2D(final int target, /* int level, */ final int internalformat, /*, int width, int height, int border, */ + final int format /*, int type, Buffer pixels */) { final int ifmt; if(GL.GL_TEXTURE_2D == target) { switch(internalformat) { @@ -316,7 +317,7 @@ public class FixedFuncPipeline { textureFormatDirty = true; }*/ - public void glTexEnvi(int target, int pname, int value) { + public void glTexEnvi(final int target, final int pname, final int value) { if(GL2ES1.GL_TEXTURE_ENV == target && GL2ES1.GL_TEXTURE_ENV_MODE == pname) { final int mode; switch( value ) { @@ -329,10 +330,10 @@ public class FixedFuncPipeline { case GL2ES1.GL_DECAL: mode = 3; break; - case GL2ES1.GL_BLEND: + case GL.GL_BLEND: mode = 4; break; - case GL2ES1.GL_REPLACE: + case GL.GL_REPLACE: mode = 5; break; case GL2ES1.GL_COMBINE: @@ -347,27 +348,27 @@ public class FixedFuncPipeline { System.err.println("FixedFuncPipeline: Unimplemented TexEnv: target "+toHexString(target)+", pname "+toHexString(pname)+", mode: "+toHexString(value)); } } - private void setTextureEnvMode(int value) { + private void setTextureEnvMode(final int value) { if( value != textureEnvMode.get(activeTextureUnit) ) { textureEnvMode.put(activeTextureUnit, value); textureEnvModeDirty = true; } } - public void glGetTexEnviv(int target, int pname, IntBuffer params) { // FIXME + public void glGetTexEnviv(final int target, final int pname, final IntBuffer params) { // FIXME System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname)); } - public void glGetTexEnviv(int target, int pname, int[] params, int params_offset) { // FIXME + public void glGetTexEnviv(final int target, final int pname, final int[] params, final int params_offset) { // FIXME System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname)); } // // Point Sprites // - public void glPointSize(float size) { + public void glPointSize(final float size) { pointParams.put(0, size); pointParamsDirty = true; } - public void glPointParameterf(int pname, float param) { + public void glPointParameterf(final int pname, final float param) { switch(pname) { case GL2ES1.GL_POINT_SIZE_MIN: pointParams.put(2, param); @@ -375,13 +376,13 @@ public class FixedFuncPipeline { case GL2ES1.GL_POINT_SIZE_MAX: pointParams.put(3, param); break; - case GL2ES2.GL_POINT_FADE_THRESHOLD_SIZE: + case GL.GL_POINT_FADE_THRESHOLD_SIZE: pointParams.put(4+3, param); break; } pointParamsDirty = true; } - public void glPointParameterfv(int pname, float[] params, int params_offset) { + public void glPointParameterfv(final int pname, final float[] params, final int params_offset) { switch(pname) { case GL2ES1.GL_POINT_DISTANCE_ATTENUATION: pointParams.put(4+0, params[params_offset + 0]); @@ -391,7 +392,7 @@ public class FixedFuncPipeline { } pointParamsDirty = true; } - public void glPointParameterfv(int pname, java.nio.FloatBuffer params) { + public void glPointParameterfv(final int pname, final java.nio.FloatBuffer params) { final int o = params.position(); switch(pname) { case GL2ES1.GL_POINT_DISTANCE_ATTENUATION: @@ -405,7 +406,7 @@ public class FixedFuncPipeline { // private int[] pointTexObj = new int[] { 0 }; - private void glDrawPoints(GL2ES2 gl, GLRunnable2<Object,Object> glDrawAction, Object args) { + private void glDrawPoints(final GL2ES2 gl, final GLRunnable2<Object,Object> glDrawAction, final Object args) { if(gl.isGL2GL3()) { gl.glEnable(GL2GL3.GL_VERTEX_PROGRAM_POINT_SIZE); } @@ -428,13 +429,13 @@ public class FixedFuncPipeline { } private static final GLRunnable2<Object, Object> glDrawArraysAction = new GLRunnable2<Object,Object>() { @Override - public Object run(GL gl, Object args) { - int[] _args = (int[])args; + public Object run(final GL gl, final Object args) { + final int[] _args = (int[])args; gl.glDrawArrays(GL.GL_POINTS, _args[0], _args[1]); return null; } }; - private final void glDrawPointArrays(GL2ES2 gl, int first, int count) { + private final void glDrawPointArrays(final GL2ES2 gl, final int first, final int count) { glDrawPoints(gl, glDrawArraysAction, new int[] { first, count }); } @@ -442,7 +443,7 @@ public class FixedFuncPipeline { // Lighting // - public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) { + public void glLightfv(final GL2ES2 gl, int light, final int pname, final java.nio.FloatBuffer params) { shaderState.useProgram(gl, true); light -=GLLightingFunc.GL_LIGHT0; if(0 <= light && light < MAX_LIGHTS) { @@ -490,7 +491,7 @@ public class FixedFuncPipeline { } } - public void glMaterialfv(GL2ES2 gl, int face, int pname, java.nio.FloatBuffer params) { + public void glMaterialfv(final GL2ES2 gl, final int face, final int pname, final java.nio.FloatBuffer params) { shaderState.useProgram(gl, true); switch (face) { @@ -544,9 +545,9 @@ public class FixedFuncPipeline { // Misc States // - public void glShadeModel(GL2ES2 gl, int mode) { + public void glShadeModel(final GL2ES2 gl, final int mode) { shaderState.useProgram(gl, true); - GLUniformData ud = shaderState.getUniform(mgl_ShadeModel); + final GLUniformData ud = shaderState.getUniform(mgl_ShadeModel); if(null!=ud) { ud.setData(mode); shaderState.uniform(gl, ud); @@ -580,7 +581,7 @@ public class FixedFuncPipeline { } } */ - public void glAlphaFunc(int func, float ref) { + public void glAlphaFunc(final int func, final float ref) { int _func; switch(func) { case GL.GL_NEVER: @@ -627,7 +628,7 @@ public class FixedFuncPipeline { * eg this call must not be passed to an underlying ES2 implementation. * true if this call shall be passed to an underlying GL2ES2/ES2 implementation as well. */ - public boolean glEnable(int cap, boolean enable) { + public boolean glEnable(final int cap, final boolean enable) { switch(cap) { case GL.GL_BLEND: case GL.GL_DEPTH_TEST: @@ -684,7 +685,7 @@ public class FixedFuncPipeline { return false; } - int light = cap - GLLightingFunc.GL_LIGHT0; + final int light = cap - GLLightingFunc.GL_LIGHT0; if(0 <= light && light < MAX_LIGHTS) { if ( (lightsEnabled.get(light)==1) != enable ) { lightsEnabled.put(light, enable?1:0); @@ -700,7 +701,7 @@ public class FixedFuncPipeline { // Draw // - public void glDrawArrays(GL2ES2 gl, int mode, int first, int count) { + public void glDrawArrays(final GL2ES2 gl, int mode, final int first, final int count) { switch(mode) { case GL2.GL_QUAD_STRIP: mode=GL.GL_TRIANGLE_STRIP; @@ -708,12 +709,12 @@ public class FixedFuncPipeline { case GL2.GL_POLYGON: mode=GL.GL_TRIANGLE_FAN; break; - case GL2ES1.GL_POINTS: + case GL.GL_POINTS: glDrawPointArrays(gl, first, count); return; } validate(gl, true); - if ( GL2.GL_QUADS == mode && !gl.isGL2() ) { + if ( GL2GL3.GL_QUADS == mode && !gl.isGL2() ) { for (int j = first; j < count - 3; j += 4) { gl.glDrawArrays(GL.GL_TRIANGLE_FAN, j, 4); } @@ -721,25 +722,25 @@ public class FixedFuncPipeline { gl.glDrawArrays(mode, first, count); } } - public void glDrawElements(GL2ES2 gl, int mode, int count, int type, java.nio.Buffer indices) { + public void glDrawElements(final GL2ES2 gl, final int mode, final int count, final int type, final java.nio.Buffer indices) { validate(gl, true); - if ( GL2.GL_QUADS == mode && !gl.isGL2() ) { + if ( GL2GL3.GL_QUADS == mode && !gl.isGL2() ) { final int idx0 = indices.position(); if( GL.GL_UNSIGNED_BYTE == type ) { final ByteBuffer b = (ByteBuffer) indices; for (int j = 0; j < count; j++) { - gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x000000ff & b.get(idx0+j)), 4); + gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x000000ff & b.get(idx0+j), 4); } } else if( GL.GL_UNSIGNED_SHORT == type ){ final ShortBuffer b = (ShortBuffer) indices; for (int j = 0; j < count; j++) { - gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x0000ffff & b.get(idx0+j)), 4); + gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x0000ffff & b.get(idx0+j), 4); } } else { final IntBuffer b = (IntBuffer) indices; for (int j = 0; j < count; j++) { - gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4); + gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0xffffffff & b.get(idx0+j), 4); } } } else { @@ -747,7 +748,7 @@ public class FixedFuncPipeline { if( !gl.getContext().isCPUDataSourcingAvail() ) { throw new GLException("CPU data sourcing n/a w/ "+gl.getContext()); } - if( GL2ES1.GL_POINTS != mode ) { + if( GL.GL_POINTS != mode ) { ((GLES2)gl).glDrawElements(mode, count, type, indices); } else { // FIXME GL_POINTS ! @@ -755,11 +756,11 @@ public class FixedFuncPipeline { } } } - public void glDrawElements(GL2ES2 gl, int mode, int count, int type, long indices_buffer_offset) { + public void glDrawElements(final GL2ES2 gl, final int mode, final int count, final int type, final long indices_buffer_offset) { validate(gl, true); - if ( GL2.GL_QUADS == mode && !gl.isGL2() ) { + if ( GL2GL3.GL_QUADS == mode && !gl.isGL2() ) { throw new GLException("Cannot handle indexed QUADS on !GL2 w/ VBO due to lack of CPU index access"); - } else if( GL2ES1.GL_POINTS != mode ) { + } else if( GL.GL_POINTS != mode ) { // FIXME GL_POINTS ! gl.glDrawElements(mode, count, type, indices_buffer_offset); } else { @@ -777,7 +778,7 @@ public class FixedFuncPipeline { return n; } - public void validate(GL2ES2 gl, boolean selectShader) { + public void validate(final GL2ES2 gl, final boolean selectShader) { if( selectShader ) { if( ShaderSelectionMode.AUTO == requestedShaderSelectionMode) { final ShaderSelectionMode newMode; @@ -832,7 +833,7 @@ public class FixedFuncPipeline { if(colorVAEnabledDirty) { ud = shaderState.getUniform(mgl_ColorEnabled); if(null!=ud) { - int ca = true == shaderState.isVertexAttribArrayEnabled(GLPointerFuncUtil.mgl_Color) ? 1 : 0 ; + final int ca = true == shaderState.isVertexAttribArrayEnabled(GLPointerFuncUtil.mgl_Color) ? 1 : 0 ; if(ca!=ud.intValue()) { ud.setData(ca); shaderState.uniform(gl, ud); @@ -926,7 +927,7 @@ public class FixedFuncPipeline { } } - public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) { + public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated) { if(null == sb) { sb = new StringBuilder(); } @@ -956,14 +957,14 @@ public class FixedFuncPipeline { private static final String constMaxTextures4 = "#define MAX_TEXTURE_UNITS 4\n"; private static final String constMaxTextures8 = "#define MAX_TEXTURE_UNITS 8\n"; - private final void customizeShader(GL2ES2 gl, ShaderCode vp, ShaderCode fp, String maxTextureDefine) { - int rsVpPos = vp.defaultShaderCustomization(gl, true, true); - int rsFpPos = fp.defaultShaderCustomization(gl, true, true); + private final void customizeShader(final GL2ES2 gl, final ShaderCode vp, final ShaderCode fp, final String maxTextureDefine) { + final int rsVpPos = vp.defaultShaderCustomization(gl, true, true); + final int rsFpPos = fp.defaultShaderCustomization(gl, true, true); vp.insertShaderSource(0, rsVpPos, maxTextureDefine); fp.insertShaderSource(0, rsFpPos, maxTextureDefine); } - private final void loadShaderPoints(GL2ES2 gl) { + private final void loadShaderPoints(final GL2ES2 gl) { if( null != shaderProgramPoints ) { return; } @@ -981,7 +982,7 @@ public class FixedFuncPipeline { } } - private final void loadShader(GL2ES2 gl, ShaderSelectionMode mode) { + private final void loadShader(final GL2ES2 gl, final ShaderSelectionMode mode) { final boolean loadColor = ShaderSelectionMode.COLOR == mode; final boolean loadColorTexture2 = ShaderSelectionMode.COLOR_TEXTURE2 == mode; final boolean loadColorTexture4 = ShaderSelectionMode.COLOR_TEXTURE4 == mode; @@ -1068,7 +1069,7 @@ public class FixedFuncPipeline { } } - private ShaderProgram selectShaderProgram(GL2ES2 gl, ShaderSelectionMode newMode) { + private ShaderProgram selectShaderProgram(final GL2ES2 gl, ShaderSelectionMode newMode) { if(ShaderSelectionMode.AUTO == newMode) { newMode = ShaderSelectionMode.COLOR; } @@ -1098,7 +1099,7 @@ public class FixedFuncPipeline { return sp; } - private void init(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) { + private void init(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) { if(null==pmvMatrix) { throw new GLException("PMVMatrix is null"); } @@ -1157,7 +1158,7 @@ public class FixedFuncPipeline { } } - private String toHexString(int i) { + private String toHexString(final int i) { return "0x"+Integer.toHexString(i); } |