Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: beginner question on why this lib exists? #12

Open
deckarep opened this issue Sep 27, 2021 · 2 comments
Open

Question: beginner question on why this lib exists? #12

deckarep opened this issue Sep 27, 2021 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@deckarep
Copy link

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!

@ikskuh ikskuh added the help wanted Extra attention is needed label Sep 28, 2021
@ikskuh
Copy link
Owner

ikskuh commented Sep 28, 2021

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

@deckarep
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants