Improved API for glBufferData
This commit is contained in:
parent
5ef40a803a
commit
9ecd426e31
|
@ -224,14 +224,8 @@ public final class VBOIndexTest {
|
|||
indices = ByteBuffer.allocateDirect(4 * 4).order(ByteOrder.nativeOrder()).asIntBuffer();
|
||||
indices.put(0).put(1).put(2).put(3);
|
||||
indices.rewind();
|
||||
ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB,
|
||||
2 * 4 * 4,
|
||||
(ByteBuffer)null,
|
||||
ARBBufferObject.GL_STREAM_DRAW_ARB);
|
||||
ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB,
|
||||
4 * 4,
|
||||
(ByteBuffer)null,
|
||||
ARBBufferObject.GL_STREAM_DRAW_ARB);
|
||||
ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 2 * 4 * 4, ARBBufferObject.GL_STREAM_DRAW_ARB);
|
||||
ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, 4 * 4, ARBBufferObject.GL_STREAM_DRAW_ARB);
|
||||
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
GL11.glVertexPointer(2, GL11.GL_FLOAT, 0, 0);
|
||||
}
|
||||
|
|
|
@ -197,10 +197,7 @@ public final class VBOTest {
|
|||
ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, buffer_id);
|
||||
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);
|
||||
ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB,
|
||||
2 * 4 * 4,
|
||||
(ByteBuffer)null,
|
||||
ARBBufferObject.GL_STREAM_DRAW_ARB);
|
||||
ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 2 * 4 * 4, ARBBufferObject.GL_STREAM_DRAW_ARB);
|
||||
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
GL11.glVertexPointer(2, GL11.GL_FLOAT, 0, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue