Login  Register

Re: GL2ES2 : glEnableClientState(GL2ES2.GL_VERTEX_ARRAY) issue

Posted by vslash on Mar 05, 2013; 6:07pm
URL: https://forum.jogamp.org/GL2ES2-glEnableClientState-GL2ES2-GL-VERTEX-ARRAY-issue-tp4028490p4028511.html

Ok, i got it :
IMHO :
1) GL2ES1 : when using a VBO (ARRAY_BUFFER) and an element-VBO (ELEMENT_ARRAY_BUFFER) it appear glVertexPointer() call do the task (Jogl : GPointerFunc package set it, as for glColorPointer(), glNormalPointer() and so forth). Sequence is simply to
- binding VBO and elementVBO.
- enabling data in use (GL_VERTEX_ARRAY, GL_NORMAL_ARRAY, GL_COLOR ...),
- then using the right pointer (vertex, normal, colors ...)

2) GPointerFunc.* is not available on GL2ES2 because we use programmable pipeline,  instead we are using a VertexAttribPointer that "link" our data with the shader pipeline.
So, elementVBO is used through the shader too.

3) GL2ES2 : as specified by "OpenGL ES 2.0 API Quick Reference Card" :
--->
void DrawElements(enum mode, sizei count, enum type, void *indices);
If an ELEMENT_ARRAY_BUFFER is bound, the indices will be read from the bound buffer, and indices is treated as an offset within the buffer.
<---

4) i still don't understand why my case don't work upon Jogl/GL2ES2 (ie using VBO and elementVBO together).
Binding the elementVBO would be sufficient, as specified above.

Should you ask anybody using this feature ? I understand that i would be outside the use of Jogl and perhaps the role of this forum.

Anyway, thanks for your assistance,
v/