Page MenuHome

Fix: get bgl methods working with buffer objects

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



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.


Diff Detail

Event Timeline

Thomas Szepe (hg1) retitled this revision from to Fix: get bgl methods working with buffer objects.Dec 8 2016, 1:00 PM
Thomas Szepe (hg1) updated this object.
Thomas Szepe (hg1) updated this revision to Diff 7951.

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


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.

Porteries Tristan (panzergame) resigned from this revision.

@Thomas Szepe (hg1) : I used the O&python parsing to call a special function checking between the buffer conversion and the integer conversion. It avoids using a second function wrapper doing a lazy check by clearing the conversion error.

This special conversion is owned by a type named GLaddr for all the addresses coming from a buffer or an offset of a current bound VBO.

@Thomas Szepe (hg1) : What do you think about this ?

I am sorry for the late response. I don't check my email last time.
Your solution is better than my. I also tried to do the same but I don't found a way to add a check function to the parameter reference macro.

Actually I don't have tested it. But I think you have already done it.

@Porteries Tristan (panzergame) I tried your version with 2.8 but it does not work :(

The original diff by @Thomas Szepe (hg1) works fine after some adjustments but throws a lot of warnings when compiling.

It seems like the issue this patch is addressing has been fixed in master, partially due to

Edit: No it is not, we still need this patch!