diff options
author | Harvey Harrison <[email protected]> | 2013-10-17 22:27:27 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2013-10-17 22:27:27 -0700 |
commit | 5e9c02bce7b241a0bf95c8abca9a91cd25e51ed3 (patch) | |
tree | 78e913afc74a64e519d69dfb9aa886dd41ec16ed /src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java | |
parent | 2ebf1bf35928e35ded6e38df64dee7aa578ae3c7 (diff) |
jogl: remove all trailing whitespace
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java index eaf8dc30a..dba408554 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java +++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,12 +20,12 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. */ - + package jogamp.opengl.util.glsl; import java.nio.FloatBuffer; @@ -45,33 +45,33 @@ import javax.media.opengl.fixedfunc.GLMatrixFunc; public class GLSLTextureRaster { private final boolean textureVertFlipped; private final int textureUnit; - + private ShaderProgram sp; private PMVMatrix pmvMatrix; private GLUniformData pmvMatrixUniform; private GLUniformData activeTexUniform; private GLArrayDataServer interleavedVBO; - + public GLSLTextureRaster(int textureUnit, boolean textureVertFlipped) { this.textureVertFlipped = textureVertFlipped; this.textureUnit = textureUnit; } - + public int getTextureUnit() { return textureUnit; } static final String shaderBasename = "texture01_xxx"; static final String shaderSrcPath = "../../shader"; static final String shaderBinPath = "../../shader/bin"; - + public void init(GL2ES2 gl) { // Create & Compile the shader objects - final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), + final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), shaderSrcPath, shaderBinPath, shaderBasename, true); - final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(), + final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(), shaderSrcPath, shaderBinPath, shaderBasename, true); rsVp.defaultShaderCustomization(gl, true, true); rsFp.defaultShaderCustomization(gl, true, true); - + // Create & Link the shader program sp = new ShaderProgram(); sp.add(rsVp); @@ -80,13 +80,13 @@ public class GLSLTextureRaster { throw new GLException("Couldn't link program: "+sp); } sp.useProgram(gl, true); - + // setup mgl_PMVMatrix pmvMatrix = new PMVMatrix(); pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION); pmvMatrix.glLoadIdentity(); pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW); - pmvMatrix.glLoadIdentity(); + pmvMatrix.glLoadIdentity(); pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv if( pmvMatrixUniform.setLocation(gl, sp.program()) < 0 ) { throw new GLException("Couldn't locate "+pmvMatrixUniform+" in shader: "+sp); @@ -105,9 +105,9 @@ public class GLSLTextureRaster { } else { s_quadTexCoords = s_quadTexCoords00; } - + interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+2, GL.GL_FLOAT, false, 2*4, GL.GL_STATIC_DRAW); - { + { final GLArrayData vArrayData = interleavedVBO.addGLSLSubArray("mgl_Vertex", 3, GL.GL_ARRAY_BUFFER); if( vArrayData.setLocation(gl, sp.program()) < 0 ) { throw new GLException("Couldn't locate "+vArrayData+" in shader: "+sp); @@ -116,15 +116,15 @@ public class GLSLTextureRaster { if( tArrayData.setLocation(gl, sp.program()) < 0 ) { throw new GLException("Couldn't locate "+tArrayData+" in shader: "+sp); } - final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer(); + final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer(); for(int i=0; i<4; i++) { ib.put(s_quadVertices, i*3, 3); ib.put(s_quadTexCoords, i*2, 2); - } + } } interleavedVBO.seal(gl, true); interleavedVBO.enableBuffer(gl, false); - + sp.useProgram(gl, false); } @@ -133,14 +133,14 @@ public class GLSLTextureRaster { pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION); pmvMatrix.glLoadIdentity(); pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f); - + pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); pmvMatrix.glLoadIdentity(); - + sp.useProgram(gl, true); gl.glUniform(pmvMatrixUniform); sp.useProgram(gl, false); - } + } } public void dispose(GL2ES2 gl) { @@ -162,34 +162,34 @@ public class GLSLTextureRaster { } public void display(GL2ES2 gl) { - if(null != sp) { - sp.useProgram(gl, true); + if(null != sp) { + sp.useProgram(gl, true); interleavedVBO.enableBuffer(gl, true); - + gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4); - - interleavedVBO.enableBuffer(gl, false); + + interleavedVBO.enableBuffer(gl, false); sp.useProgram(gl, false); } } - - private static final float[] s_quadVertices = { + + private static final float[] s_quadVertices = { -1f, -1f, 0f, // LB 1f, -1f, 0f, // RB -1f, 1f, 0f, // LT - 1f, 1f, 0f // RT + 1f, 1f, 0f // RT }; - private static final float[] s_quadTexCoords00 = { + private static final float[] s_quadTexCoords00 = { 0f, 0f, // LB 1f, 0f, // RB - 0f, 1f, // LT + 0f, 1f, // LT 1f, 1f // RT }; - private static final float[] s_quadTexCoords01 = { + private static final float[] s_quadTexCoords01 = { 0f, 1f, // LB 1f, 1f, // RB - 0f, 0f, // LT + 0f, 0f, // LT 1f, 0f // RT - }; + }; } |