Fix: get bgl methods working with buffer objects
Needs ReviewPublic

Authored by Thomas Szepe (hg1) on Dec 8 2016, 1:00 PM.

Details

Summary

To get the below list of BGL methods working with buffer objects (VBO,
IBO), we need to pass the last parameter also as an integer value.

glColorPointer
glDrawElements
glDrawRangeElements
glEdgeFlagPointer
(glFogCoordPointer)
glIndexPointer
glInterleavedArrays
glNormalPointer
(glSecondaryColor)
glTexCoordPointer
glVertexPointe
glVertexAttribPointer

BGL_VBO_VAO.blend

Diff Detail

source/blender/python/generic/bgl.c
1025

Could you explain the goal/difference of this new macro wrapper ?

source/blender/python/generic/bgl.c
1025

The difference to BGL_Wrap is that BGL_Wrap2 has check for to arg_list.
If the first argument list can be parsed successfully the arg_list types (in this case the integer = GLvuint (void *)integer) will be used for the OpenGL function.
If not the second argument list arg_list2 (in this case the original bgl.Buffer = GLvoidP) wil be used.

@ Aaron Carlisle.
Why you have edited the tags? The BGL wrapper is is for both BGE and Blender.
Also why you have removed Campbell from the reviewer list. He is the Python API module owner.
https://wiki.blender.org/index.php/Dev:Doc/Process/Module_Owners/List