SDL.zig icon indicating copy to clipboard operation
SDL.zig copied to clipboard

Question: beginner question on why this lib exists?

Open deckarep opened this issue 4 years ago • 2 comments

Hello,

I’m currently looking into building a zig-based game using SDL.

I know that you can import the C code directly using Zigs awesome understanding of C/C++ source code but I’m curious why this library of bindings exists and why you’d want to use it?

I’m only asking because this lib seems very convenient to hide the C complexity away and the possible casting that would need to happen back and forth between the world of zig and C.

Am I on the right track on why using this would be useful?

Thanks for your time!

deckarep avatar Sep 27 '21 15:09 deckarep

Yes, this library exists to have more precise type mappings for Zig. SDL has documentation that talks about the allowed values for APIs, but C cannot reflect that functions expect arrays of N items for example. We can model such behaviour with Zig

ikskuh avatar Sep 28 '21 08:09 ikskuh

That makes perfect sense. Thanks for the explanation! Feel free to close.

deckarep avatar Sep 29 '21 04:09 deckarep