floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.53k stars 468 forks source link

Improve odin bindings, DLL support #1023

Closed jakubtomsu closed 2 months ago

jakubtomsu commented 2 months ago

This PR does a number of modifications to the Odin binding generator, and the project structure:

Most of these changes are what I used in my game Solar Storm. Sometimes it's just what I personally prefer, but I think it ultimately does make the bindings easier to work with.

Note: these changes are still a bit experimental as I couldn't test 100% everything before submitting the PR (like the automatic uploading of bindings on each commit).

jakubtomsu commented 2 months ago

Linked PR from the sokol-odin repo: https://github.com/floooh/sokol-odin/pull/11

jakubtomsu commented 2 months ago

It's a pretty big PR, so in case you don't like something let me know

floooh commented 2 months ago

Looks good! I'll try to give it a whirl on the weekend before merging.

I was wondering why you moved the top-level scripts to build the C libraries into a subdirectory (because I preferred to have them visible at the top level), but this is a good reason:

This means the sokol folder is now completely standalone and can be easily copied into the source directory of any project.

PS: don't worry about the failed CI, I guess that's because the PR expects the new directory structure in sokol-odin.

jakubtomsu commented 2 months ago

Thank you! I agree the build scripts look nicer in the top-level folder, but this way just fits the odin workflow a bit better...

floooh commented 2 months ago

And merged. Many thanks!