Porting LWJGL to iPhone/IOS - what would need to be done?

Started by sixman9, December 07, 2012, 01:26:50

Previous topic - Next topic

sixman9

Hi,
I'm a complete LWJGL newbie. Putting aside the obvious necessity for a JVM (I'm considering Avian), what is actually needed to integrate LWJGL into OpenGL and OpenAL etc. on iPhone/IOS?

Are there any JNI-like generation tools that could help, i.e. JNAerator, Gluegen, Swig etc.

Also, this post mentions the following 9 files:

Quoteorg_lwjgl_Display.cpp
org_lwjgl_opengl_BaseGL.cpp
org_lwjgl_input_Controller.cpp
org_lwjgl_opengl_Pbuffer.cpp
org_lwjgl_input_Cursor.cpp
org_lwjgl_Sys.cpp
org_lwjgl_input_Keyboard.cpp
org_lwjgl_Window.cpp
org_lwjgl_input_Mouse.cpp

Could you explain or point me at their usage?

Thanks

Rich

Mickelukas

I'd suggest that you look into LibGDX instead of trying to port it yourself. They are currently having iOS support in the pipeline.

Mike

sixman9

Quote from: Mickelukas on December 07, 2012, 07:52:49
I'd suggest that you look into LibGDX instead of trying to port it yourself. They are currently having iOS support in the pipeline.

Mike

Hi Mike,
I appreciate your answer, and yes, I'm aware of libGDX's efforts, however, from a purely academic/theoretic perspective, it would be very interesting to me to find out what exactly would be necessary to do an IOS LWJGL port directly, using JNI etc. once again assuming a reasonably good IOS-compatible JVM were available?

An explanation of the requirements and or pros/cons would still be very useful to me.

Thanks

Rich

princec

Basically any Java file with native C code behind it would need porting, then a few new support classes to paper over the cracks. But it is all dwarfed by the inability to run a JVM on iOS in the first place and there still does not exist any reasonably sensible Java->native compiler toolchain for iOS.

Cas :)


sixman9

Quote from: princec on December 10, 2012, 08:30:03
Basically any Java file with native C code behind it would need porting, then a few new support classes to paper over the cracks. But it is all dwarfed by the inability to run a JVM on iOS in the first place and there still does not exist any reasonably sensible Java->native compiler toolchain for iOS.

Cas :)

There *IS* an IOS compatible JVM. Avian JVM is already running a near as full JVM on IOS, using OpenJDK 7, and is in active development. Applications can be compiled in 2 different ways, one of which is Ahead-of-time (AOT) which means that the output binary contain no Java bytecode.

I'm guessing I'm going to either have to contact the main LWJGL developers or start another thread, because although porting LWJGL to IOS might appear to be a lame or dead-end intention, hopefully, now you all can see that it might not be entirely pointless.

The LibGDX project, which itself uses LWJGL, tried to take advantage of Avian, but decided against it because it [currently] uses software floating point arithmetic (they've now gone with transcoding to C# MSIL and using the $399+ Monotouch-IOS framework).

My idea would be to somehow get LWJGL working against the C/Objective-C IOS libraries, hopefully, in time for a more mature future release of Avian.

Atlhough maybe I should have laid this all out more fully in my initial post, my questions still stands as to what exactly (in terms of files/functions to implement) is required to port LWJGL to a new C-Based system?

Thanks

Rich

P.S. Take a look at this post for another project which merges a Java-GUI project with Avian  on IOS (there is an accompanying Github example project).