tjammer / raylib-ocaml

OCaml bindings for raylib and raygui
https://tjammer.github.io/raylib-ocaml/
MIT License
175 stars 14 forks source link

Support OCaml 5 ;-) #29

Closed tjammer closed 1 year ago

tjammer commented 1 year ago
    ...and support OCaml 5 ;-)

Originally posted by @ul in https://github.com/tjammer/raylib-ocaml/issues/27#issuecomment-1373143295

tjammer commented 1 year ago

Currently blocked by ppx_cstubs, which does not build with OCaml 5. We technically don't need this package, it just gets rid off some ctypes boilerplate

tjammer commented 1 year ago

Update: ppx_cstubs supports bitmask enums, which I have not yet managed to emulate using only ctypes. As far as I understand, the ppx extracts the constants and uses them to build a view. At least for enums, ctypes extracts them to a opaque const type, which cannot be used in views directly. And there are no functions for getting values out of it, unfortunately.

Long story short: We might have to continue to use the ppx

ul commented 1 year ago

Thanks for looking into it, I’ll be tracking ppx_stubs for OCaml versions support as well then.

tjammer commented 1 year ago

We don't need ppx_cstubs after all, I made bitmasks work without it. It's gonna need a few days to make all the modifications but I hope to have something working by the end of the week

tjammer commented 1 year ago

As of 6db8153809a16468a3fee27389af3da6ba451a7c the bindings now work with OCaml 5. I'll update to raylib 4.2 this week and then prepare a release to opam. In the meantime, you can use opam pin to use the bindings with OCaml 5.