Not-Nik / raylib-zig

Manually tweaked, auto-generated raylib bindings for zig. https://github.com/raysan5/raylib
MIT License
619 stars 115 forks source link

Unable to pass 0 to the last parameter of `rlDrawVertexArrayElements` #112

Closed Zylann closed 3 months ago

Zylann commented 3 months ago

In C, rlDrawVertexArrayElements takes a const void *buffer as last parameter, which can be 0, as seen in DrawMesh: https://github.com/raysan5/raylib/blob/c1ea32655aad97402ea3b215ab7b414d0809bb8d/src/rmodels.c#L1511

However, in the Zig bindings, that parameter is exposed as *const anyopaque. It prevents from passing null or 0, so the function can't be used like in raylib's code. Perhaps it should be changed to ?*const anyopaque?

Not-Nik commented 3 months ago

I wonder if maybe some of the other rlgl functions that take void* arguments can also accept null pointers