float[] vertices = new float[] { 0.0f, 1.0f, -2.0f, -1.0f, -1.0f,
-2.0f, 1.0f, -1.0f, -2.0f };
int[] indices = new int[] {0, 1, 2};
// create the vertexBuffer
buffer = new Buffer(webGLWrapper, BufferTarget.ARRAY_BUFFER, BufferUsage.STATIC_DRAW);
buffer.addData(VERTICES, new FloatArray(vertices));
// create the indexBuffer
indexBuffer = new Buffer(webGLWrapper, BufferTarget.ELEMENT_ARRAY_BUFFER, BufferUsage.STREAM_DRAW);
indexBuffer.addData(INDICES, new UnsignedByteArray(indices));
float[] colors = new float[] { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f,
0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f };
buffer.addData(COLORS, new FloatArray(colors));