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

feat: SDL 3.1.6 bindings #1033

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eigenraven
Copy link

After the discussion on discord where interest for SDL3 bindings was expressed, I thought I'd start on them to try to help. Currently I've just set up the first header of the library that holds some utility functions and tested it locally on my Linux install.

If possible, I'd like to get some feedback if I'm on the right path and if I should make any changes to the code structure before I run the extractor and adjust the bindings on the 70 or so SDL headers (probably fewer, as quite a lot of them are wrappers for functionality Java already provides - like threads, atomics and synchronization primitives)

Related to #174

@Spasi
Copy link
Member

Spasi commented Dec 29, 2024

Hey @eigenraven, thanks for getting this started!

It's looking good structure-wise, except you don't need to add the SDL headers to LWJGL. We'll build the SDL library separately, in an LWJGL-CI fork, the LWJGL build itself won't have to do any native compilation. Except in the rare case of having to support a function that passes/returns a struct by-value. Even then, we may choose to support such functions dynamically with libffi, if they're only one or two. Anyway, you'll know you may need the headers if you see .c files being generated under modules/lwjgl/sdl3/src/generated/c/.

For reference, other bindings that should have similar structure to SDL are: GLFW, OpenAL Soft, bgfx, freetype, etc. (you'll find all of them in LWJGL-CI).

You should probably wait a bit before doing more work on this though. The next LWJGL version (3.4.0) is going to remove documentation from bindings. I noticed that you've already added a lot of documentation (in SDL_stdinc.kt) and all that is going away. The Kotlin DSL is also going to be simplified. I'm almost done with this refactoring and will be pushing it in a few days. Better wait to rebase on top of that before adding more headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants