diff options
author | Sven Gothel <[email protected]> | 2008-08-21 17:40:54 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-08-21 17:40:54 +0000 |
commit | 0b657e84188652ea4e400861f778bdebcd35d6b3 (patch) | |
tree | dbac158f594cfcdb01962678fbc54b212a256460 /src/demos/es2/RedSquare.java | |
parent | 53b839d9c65114998b561a9a9f9309dff9636f77 (diff) |
ES2 performance test: 1st draft
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@277 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/es2/RedSquare.java')
-rwxr-xr-x | src/demos/es2/RedSquare.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java index 089ebfe..ce1d0c2 100755 --- a/src/demos/es2/RedSquare.java +++ b/src/demos/es2/RedSquare.java @@ -138,7 +138,7 @@ public class RedSquare implements MouseListener, GLEventListener { throw new GLException("Error setting PMVMatrix in shader: "+st); } // Allocate vertex arrays - GLArrayDataClient vertices = GLArrayDataClient.createGLSL(-1, "mgl_Vertex", 3, gl.GL_FLOAT, false, 4); + GLArrayDataClient vertices = GLArrayDataClient.createGLSL("mgl_Vertex", 3, gl.GL_FLOAT, false, 4); { // Fill them up FloatBuffer verticeb = (FloatBuffer)vertices.getBuffer(); @@ -146,10 +146,10 @@ public class RedSquare implements MouseListener, GLEventListener { verticeb.put( 2); verticeb.put( 2); verticeb.put( 0); verticeb.put(-2); verticeb.put( -2); verticeb.put( 0); verticeb.put( 2); verticeb.put( -2); verticeb.put( 0); - verticeb.flip(); } + vertices.seal(gl, true); - GLArrayDataClient colors = GLArrayDataClient.createGLSL(-1, "mgl_Color", 4, gl.GL_FLOAT, false, 4); + GLArrayDataClient colors = GLArrayDataClient.createGLSL("mgl_Color", 4, gl.GL_FLOAT, false, 4); { // Fill them up FloatBuffer colorb = (FloatBuffer)colors.getBuffer(); @@ -157,12 +157,9 @@ public class RedSquare implements MouseListener, GLEventListener { colorb.put( 0); colorb.put( 0); colorb.put( 1); colorb.put( 1); colorb.put( 1); colorb.put( 0); colorb.put( 0); colorb.put( 1); colorb.put( 1); colorb.put( 0); colorb.put( 0); colorb.put( 1); - colorb.flip(); } + colors.seal(gl, true); - st.glVertexAttribPointer(gl, vertices); - st.glVertexAttribPointer(gl, colors); - // OpenGL Render Settings gl.glClearColor(0, 0, 0, 1); gl.glEnable(GL2ES2.GL_DEPTH_TEST); |