Not-Nik / raylib-zig

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

flags incorrectly converted in the python generator #43

Closed Veeloxfire closed 1 year ago

Veeloxfire commented 1 year ago

the SetWindowState, ClearWindowState and SetConfigFlags functions are manually set to convert their flags argument to the ConfigFlags type

However, this is incorrect. These functions are desgined to take multiple flags not just one Its UB in zig to cast to an enum from integer which doesn't represent one of the values

Because of this, trying to pass multiple flags at once to any of these will cause Zig to invoke UB (and even panic with safety checks enabled)

Not-Nik commented 1 year ago

I'll keep these as integers for now, until we find a better solution