electronstudio / jaylib

Java JNI bindings for Raylib
Other
124 stars 23 forks source link

Cross platform deployment #11

Closed JasonNumberThirteen closed 3 years ago

JasonNumberThirteen commented 4 years ago

Greetings, I'm very interested in this Java binding for "raylib". I would like to know if there are any future plans for adding support to many platforms, especially for Android and HTML5. If not, then at least explain how can I try to do it on my own, please. I realise it's easy to say, but much harder to do.

electronstudio commented 4 years ago

I have no plans beyond Windows, Mac and Linux.

I have never tried Raylib on Android myself. Assuming you have Raylib cross compiling for Android successfully then it should be possible to add it as another platform in the config file.

For HTML5, Java doesn't run on HTML5 so you would need to first solve that problem using some sort of translator. How you bind to Raylib would then depend entirely on what translator you used.

JasonNumberThirteen commented 4 years ago

Thanks for your reply. AFAIK, GWT is widely used for converting Java to HTML5 (eventually "CheerpJ").

http://www.gwtproject.org/ https://www.leaningtech.com/pages/cheerpj.html

electronstudio commented 4 years ago

I think GWT translates Java sourcecode into Javascript source code so what you would need is a Javascript binding for Raylib.

electronstudio commented 4 years ago

CheerpJ seems to translate Java bytecode to WASM, and Raylib can be compiled to WASM, so that sounds more promising, but I don't know enough about WASM to be sure and CheerpJ is non free so Im not inclined to experiment with it. It all seems a lot of work when there already exist far more mature cross platform Java libraries than Raylib, e.g, LibGDX.

JasonNumberThirteen commented 4 years ago

OK, I get it. I know there is a JavaScript binding, but I wanted to stick to Java and have one project to many platforms. Thanks for your time.

electronstudio commented 4 years ago

If you can figure out how to do it, go ahead. I think Android is probably much easier than HTML5 because at least Android runs the two languages involved, C and Java, and JavaCPP already supports Android.

JasonNumberThirteen commented 4 years ago

Alright, if I find time, I'll try to make this on my own.