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

SetConfigFlags doesn't accept enum #25

Closed mgord9518 closed 1 year ago

mgord9518 commented 1 year ago

When trying to use SetConfigFlags, a project will not build unless using Zig's @enumToInt function as it appears to accept only c_uint and not the defined ConfigFlags enum type.

Example code:``` // Doesn't build rl.SetConfigFlags(rl.ConfigFlags.FLAG_WINDOW_UNFOCUSED);

// Works rl.SetConfigFlags(@enumToInt(rl.ConfigFlags.FLAG_WINDOW_UNFOCUSED));

Not-Nik commented 1 year ago

Thanks for the report

mgord9518 commented 1 year ago

@Not-Nik unrelated and out of curiosity, I'm new to Zig but isn't the convention camelCase for functions? Is this wrapper just using PascalCase because it's what RayLib uses by default?

Not-Nik commented 1 year ago

It's because that's what raylib uses, but you're right, it should be changed

Not-Nik commented 1 year ago

I looked a bit into it, and since I can't find a way to tell Zig that an external functions has a certain link-time symbol with a different name than the one it is expecting without creating an entirely new function, the function names will stay as is.