I searched the web for an answer to my question below - without luck so far. I hope that the question makes sense…!
I develop for Android 2.2. I wish to make a GLES20 graphics application using “Java”. Furthermore I want to use VBOs.
In GL10, one rendered the VBOs (for instance) like this:
GL11 gl11 = (GL11) gl; gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertexBufferObjectId); gl11.glVertexPointer(3, GL10.GL_FLOAT, VERTEX_SIZE, 0); gl.glEnableClientState(GL10.GL_NORMAL_ARRAY); gl11.glNormalPointer(GL10.GL_FLOAT, VERTEX_SIZE, VERTEX_NORMAL_BUFFER_INDEX_OFFSET * FLOAT_SIZE); gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mElementBufferObjectId); gl11.glDrawElements(GL10.GL_TRIANGLES, mIndexCount, GL10.GL_UNSIGNED_SHORT, 0);
(this is actually an extract from the CubeMap Android example).
In GL20 everybody creates their buffers using ByteBuffer.allocateDirect. Then, they are rendered / loaded using attribute pointers
GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false, TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices); ...
(the argument “mTriangleVertices” is a Buffer, not the “name” of a VBO (int).
To my understanding the Buffers in the GL10 version are in VRAM whereas the buffers in the GLES20 version live in RAM. Unfortunately this part in the ES20 documentation by Munshi and Leech (pp. 24 / 25) is not very clear to me.
I would like to make sure that there is no need / no possibility to use buffers loaded to VRAM using glBufferData in GLES20.
Any help would be appreciated.
Kind regards, Jan
I would like to use BindBuffer in combination