tjammer / raylib-ocaml

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

JPG Support #40

Closed Firgeis closed 9 months ago

Firgeis commented 9 months ago

When trying to load a texture which is a JPG image I get the following error:

INFO: FILEIO: [resources/***.jpg] File loaded successfully
WARNING: IMAGE: Data format not supported
WARNING: IMAGE: Failed to load image data

Apparently this has to be explicitly enabled when building the lib?

https://github.com/deltaphc/raylib-rs/issues/169

tjammer commented 9 months ago

We don't have any option mechanism right now, and I'm not sure if this is something dune even supports nicely. I think enabling the common image formats (jpg and bmp) makes sense in any case, I'm surprised they aren't enabled by default.

I created a branch (https://github.com/tjammer/raylib-ocaml/tree/test-windows) with a fix, which works on linux. It doesn't yet build on windows (most likely because of encoding of the patch file), but I don't have a windows machine to test the build. I will try again in a few hours