diff options
author | Sven Gothel <[email protected]> | 2012-04-11 11:00:17 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-04-11 11:00:17 +0200 |
commit | 41b75429e3801f8bf8d5eea679487ccc49ce2584 (patch) | |
tree | 75c9fe65506bc137320648796eed8bcf20c8f3a9 /src/jogl/classes/jogamp/graph/curve/opengl | |
parent | 173b7820b3e7dfb44aab055e7427f296a864feb3 (diff) |
GLArrayData: Fix 'growBuffer()' / clarify 'initialSize' -> 'initialElementCount'
- growBuffer() was using '(osize+additional) * components' -> 'osize + (additional * components )'
- added jogl.debug.GLArrayData - notifying growBuffer()
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/opengl')
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java | 14 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java index 703fd6151..804e9ee14 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java @@ -81,16 +81,16 @@ public class VBORegion2PES2 extends GLRegion { } if(null == indicesFbo) { - final int initialSize = 256; + final int initialElementCount = 256; final ShaderState st = rs.getShaderState(); - indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialSize, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER); + indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER); indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3); indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3); indicesFbo.seal(true); texCoordFboAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT, - false, initialSize, GL.GL_STATIC_DRAW); + false, initialElementCount, GL.GL_STATIC_DRAW); st.ownAttribute(texCoordFboAttr, true); texCoordFboAttr.putf(5); texCoordFboAttr.putf(5); texCoordFboAttr.putf(5); texCoordFboAttr.putf(6); @@ -99,18 +99,18 @@ public class VBORegion2PES2 extends GLRegion { texCoordFboAttr.seal(true); verticeFboAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT, - false, initialSize, GL.GL_STATIC_DRAW); + false, initialElementCount, GL.GL_STATIC_DRAW); st.ownAttribute(verticeFboAttr, true); - indicesTxt = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialSize, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER); + indicesTxt = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER); verticeTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT, - false, initialSize, GL.GL_STATIC_DRAW); + false, initialElementCount, GL.GL_STATIC_DRAW); st.ownAttribute(verticeTxtAttr, true); texCoordTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT, - false, initialSize, GL.GL_STATIC_DRAW); + false, initialElementCount, GL.GL_STATIC_DRAW); st.ownAttribute(texCoordTxtAttr, true); if(DEBUG_INSTANCE) { diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java index 6ff6a078f..14ff0380f 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java @@ -54,17 +54,17 @@ public class VBORegionSPES2 extends GLRegion { } if(null == indices) { - final int initialSize = 256; + final int initialElementCount = 256; final ShaderState st = rs.getShaderState(); - indices = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialSize, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER); + indices = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER); verticeAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT, - false, initialSize, GL.GL_STATIC_DRAW); + false, initialElementCount, GL.GL_STATIC_DRAW); st.ownAttribute(verticeAttr, true); texCoordAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT, - false, initialSize, GL.GL_STATIC_DRAW); + false, initialElementCount, GL.GL_STATIC_DRAW); st.ownAttribute(texCoordAttr, true); if(DEBUG_INSTANCE) { |