Implemented safe VBO indices (phew)

This commit is contained in:
Elias Naur 2003-08-04 23:00:49 +00:00
parent e6cca3fda8
commit 35a1538f82
24 changed files with 821 additions and 100 deletions

View file

@ -191,9 +191,8 @@ public final class VBOTest {
vertices = ByteBuffer.allocateDirect(2*4*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
vertices.put(-50).put(-50).put(50).put(-50).put(50).put(50).put(-50).put(50);
GL.glBufferDataARB(GL.GL_ARRAY_BUFFER_ARB, 2*4*4, (ByteBuffer)null, GL.GL_STREAM_DRAW_ARB);
ByteBuffer index_buffer = Sys.createIndexBuffer(0);
GL.glEnableClientState(GL.GL_VERTEX_ARRAY);
GL.glVertexPointer(2, 0, index_buffer.asFloatBuffer());
GL.glVertexPointer(2, GL.GL_FLOAT, 0, 0);
GL.glGetInteger(GL.GL_MAX_TEXTURE_UNITS_ARB, int_buffer);
System.out.println("Number of texture units: " + int_buffer.get(0));
// Fix the refresh rate to the display frequency.