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

Adding bindings to SDL2_image #20

Closed
Armael opened this issue Jun 12, 2015 · 5 comments
Closed

Adding bindings to SDL2_image #20

Armael opened this issue Jun 12, 2015 · 5 comments

Comments

@Armael
Copy link

Armael commented Jun 12, 2015

Hi,

I was wondering what would be the be the simplest way to bind functions from SDL2_image (which is pretty useful, and that I would like to use)?
SDL2_image is distinct from the base C library, so it would be legit to separate the OCaml bindings from tsdl; however it would be great to be able to reuse the ctypes definitions from tsdl, which are not available (obviously) in the API.

I also tried a bit to just modify tsdl.ml in place to add some bindings, but I did not manage to tweak the build system to link to SDL2_image, so here I am, asking for help :-°.

-- Armael

@dbuenzli
Copy link
Owner

I would rather keep things separate separate and expose the definitions you need in order to interact with SDL. What would you need ?

Note that there are already a few undocumented unsafe_* functions that are available to interact with tsdl's otherwise abstract types. See @tokenrove 4a4ffc2 commit who explicitly mention SDL image.

That didn't make it into a release yet as I would like to have #13 solved first (but don't have the time to look into this right now).

@tokenrove
Copy link
Contributor

Incidentally, I have some SDL_image bindings in the same style as tsdl-mixer and tsdl-ttf, but I had been waiting til I had time to polish all three (including documentation and tests) to release them. But if you are interested and don't already have your bindings written, check out https://github.com/tokenrove/tsdl-image and encourage me to Do The Right Thing and get them cleaned up and into opam.

@dbuenzli
Copy link
Owner

@tokenrove if you need a release of tsdl to get them out before I manage to have a look at #13, just ping me and it will be done.

@Armael
Copy link
Author

Armael commented Jun 12, 2015

Oh, thanks for the answers! 4a4ffc2 looks great indeed, and I'll be very happy with a release of your SDL_image bindings! In the meantime I'm gonna pin the git version and try them out :).

@tokenrove
Copy link
Contributor

@dbuenzli Great to know. Thanks. I will look into it this weekend.

@Armael Let me know if there are any problems, of course.

@Armael Armael closed this as completed Jun 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants