Bug 764

Summary: glDrawElementBaseVertex cannot be used with ELEMENT_ARRAY_BUFFER objects
Product: [JogAmp] Jogl Reporter: Julien <julien.carlos>
Component: openglAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: major    
Priority: ---    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
jogl 4e225341fa11769c4da0825a3b5eb37464a732ef
Workaround: ---
Bug Depends on:    
Bug Blocks: 852    

Description Julien 2013-06-24 15:19:37 CEST
Since OpenGL 3.1 core profile, vertex indices must be passed in a buffer object bound to ELEMENT_ARRAY_BUFFER. It seems that glDrawElementBaseVertex is working like a charm when sourcing indices from client memory (using Buffer backing arrays of ints or shorts) which is ok when using the compatibility profile but it does not work with "index buffer object". There is no way to force the method to understand its "Buffer indices" argument as an offset into the current buffer object bound to ELEMENT_ARRAY_BUFFER.

Actually it would be nice to have such a signature (like we have for glDrawElements):
glDrawElementsBaseVertex(int mode, int count, int type, long indices_buffer_offset, int basevertex)

Other methods should follow the same paradigm:
glDrawElementsInstanced
glDrawRangeElementsBaseVertex
glDrawElementsInstancedBaseVertex
Comment 1 Sven Gothel 2013-06-25 21:32:58 CEST
agreed - thank you!

actually all 8 are of kind buffer object:

BufferObjectKind Element glDrawElements
BufferObjectKind Element glDrawElementsBaseVertex
BufferObjectKind Element glDrawElementsInstanced
BufferObjectKind Element glDrawElementsInstancedBaseInstance
BufferObjectKind Element glDrawElementsInstancedBaseVertex
BufferObjectKind Element glDrawRangeElementsBaseVertex
BufferObjectKind Element glDrawRangeElements
BufferObjectKind Element glDrawRangeElementsBaseVertex

.. will add this ASAP
Comment 2 Sven Gothel 2013-07-05 05:52:19 CEST
fixed