summaryrefslogtreecommitdiffstats
path: root/src/demos/es1/angeles/Angeles.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/es1/angeles/Angeles.java')
-rwxr-xr-xsrc/demos/es1/angeles/Angeles.java13
1 files changed, 10 insertions, 3 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;