gdx-backend-jtransc
gdx-backend-jtransc copied to clipboard
Add native C++ support
Since the @intrigus work with C++ pure target has evolved a lot and now the size of the executable is usually four times smaller than haxe-c++ and faster in most benchmarks.
So I think it would be interesting to additional to haxe support direct SDL2+opengl. I think both: android and ios (+ desktop targets + some consoles) supports libsdl2 & opengl.
Why SDL2? I'm more in favor of glfw to be honest.
The ideal and hardest solution would be to use the official lwjgl3-backend and make it compile with as few changes as possible. But for this we'd really need a almost complete JRE implementation...
And additionally we should find a less intrusive way to make libgdx work with jtransc, since it's very hard to update to newer libgdx versions when we have so many patches/changes. And few people are probably going to use an outdated backend.
I'm not using this library myself, but korge. So I do not actually require any special library. This was an initial proposal because noboy proposed it yet :) I know that libSDL2 is pretty portable and work for most platforms. So that's why it was my proposal. But I'm not against any other library.
Regarding to integration with libgdx: initially I had to duplicate everything because it was pretty coupled. And for example matrix operations were marked as native (with an external library) and thus didn't work on jtransc directly (I had to use gwt impl for things like that).
Probably porting lwjgl3 to jtransc would be great. Do they use JNA? Or JNI? Maybe we can do a trick to compile statically against native libgl libraries.
Maybe we can do a proof of concept trying to just open a window in a separate repository so we can determine which option is best to do this.