summaryrefslogtreecommitdiffstats
path: root/src/demos/es1/angeles
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-06-25 09:40:13 +0000
committerSven Gothel <[email protected]>2008-06-25 09:40:13 +0000
commit7c1206b1833d973b30e1b26d978d0d95315b55b6 (patch)
tree1290309417627a3db9c80a0730c52454d0550a23 /src/demos/es1/angeles
parent665ee403e75d7024f660993713a537234a2d0826 (diff)
JOGL2 GLES1 NEWT X11 - RedSquare - working
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@245 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/es1/angeles')
-rwxr-xr-xsrc/demos/es1/angeles/Angeles.java13
-rwxr-xr-xsrc/demos/es1/angeles/Main.java4
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;
}