diff options
Diffstat (limited to 'src/demos/es1/angeles')
-rwxr-xr-x | src/demos/es1/angeles/Angeles.java | 13 | ||||
-rwxr-xr-x | src/demos/es1/angeles/Main.java | 4 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/demos/es1/angeles/Angeles.java b/src/demos/es1/angeles/Angeles.java index c298adb..e793be2 100755 --- a/src/demos/es1/angeles/Angeles.java +++ b/src/demos/es1/angeles/Angeles.java @@ -249,7 +249,7 @@ public class GLObject { void seal() { - rewind(); + flip(); vbo = new int[3]; gl.glGenBuffers(3, vbo, 0); @@ -263,10 +263,10 @@ public class GLObject { if (null!=normalArray) { + gl.glEnableClientState(gl.GL_NORMAL_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo[2]); gl.glBufferData(GL.GL_ARRAY_BUFFER, normalArray.capacity() * BufferUtil.SIZEOF_INT, normalArray, GL.GL_STATIC_DRAW); gl.glNormalPointer(gl.GL_FLOAT, 0, 0); - gl.glEnableClientState(gl.GL_NORMAL_ARRAY); } else { gl.glDisableClientState(gl.GL_NORMAL_ARRAY); } @@ -281,9 +281,9 @@ public class GLObject { if (null!=normalArray) { + gl.glEnableClientState(gl.GL_NORMAL_ARRAY); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo[2]); gl.glNormalPointer(gl.GL_FIXED, 0, 0); - gl.glEnableClientState(gl.GL_NORMAL_ARRAY); } else gl.glDisableClientState(gl.GL_NORMAL_ARRAY); @@ -297,6 +297,13 @@ public class GLObject { normalArray.rewind(); } } + void flip() { + vertexArray.flip(); + colorArray.flip(); + if (normalArray != null) { + normalArray.flip(); + } + } } long sStartTick = 0; diff --git a/src/demos/es1/angeles/Main.java b/src/demos/es1/angeles/Main.java index 20a9f0a..563e554 100755 --- a/src/demos/es1/angeles/Main.java +++ b/src/demos/es1/angeles/Main.java @@ -81,8 +81,8 @@ public class Main implements MouseListener { dt0 = curTime-lastTime; if ( (curTime-lastTime) > 5000 ) { dt1 = curTime-startTime; - System.out.println(curTime/1000+"s, 5s: "+ (lastFrames*1000)/dt0 + " fps, "+ - "total: "+ (totalFrames*1000)/dt1 + " fps"); + System.out.println(dt1/1000+"s, 5s: "+ (lastFrames*1000)/dt0 + " fps, "+ + "total: "+ (totalFrames*1000)/dt1 + " fps"); lastTime=curTime; lastFrames=0; } |