summaryrefslogtreecommitdiffstats
path: root/src/demos
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-08-21 19:19:45 +0000
committerSven Gothel <[email protected]>2008-08-21 19:19:45 +0000
commit3f3932e88b992a231f90401fe5cd7965bc80ac41 (patch)
treeb23c527de7847be578f9c2a5fd1a0ebac1bb29c2 /src/demos
parentd6bbeb86e3a2d42953c7ccca4ec7287869687bbe (diff)
ES2.PerfTst: VBO-1-obj - skip enable/disable
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JOGL_2_SANDBOX@280 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos')
-rwxr-xr-xsrc/demos/es2/perftst/PerfVBOLoad.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/demos/es2/perftst/PerfVBOLoad.java b/src/demos/es2/perftst/PerfVBOLoad.java
index a832e36..42d323d 100755
--- a/src/demos/es2/perftst/PerfVBOLoad.java
+++ b/src/demos/es2/perftst/PerfVBOLoad.java
@@ -86,7 +86,7 @@ public class PerfVBOLoad extends PerfModule {
for(int j=0; j<numObjs; j++) {
if(i==0) {
vertices[j].seal(gl, true);
- } else {
+ } else if(numObjs>1) {
vertices[j].enableBuffer(gl, true);
}
@@ -101,8 +101,14 @@ public class PerfVBOLoad extends PerfModule {
t2[i][j] = System.currentTimeMillis();
gl.glDrawArrays(GL.GL_LINE_STRIP, 0, vertices[j].getElementNumber());
- vertices[j].enableBuffer(gl, false);
- colors[j].enableBuffer(gl, false);
+
+ if(numObjs>1) {
+ // we need to re-enable the buffer,
+ // incl. the vertex attribute refresh
+ // in case we switch to another buffer
+ vertices[j].enableBuffer(gl, false);
+ colors[j].enableBuffer(gl, false);
+ }
t3[i][j] = System.currentTimeMillis();
}