LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: spasi on September 03, 2015, 09:55:10

Title: LWJGL 2 migration guide to LWJGL 3
Post by: spasi on September 03, 2015, 09:55:10
If you'd like to port your existing LWJGL 2 code to LWJGL 3, please read:

The LWJGL 3 Migration Guide (https://github.com/LWJGL/lwjgl3-wiki/wiki/2.6.6-LWJGL3-migration)
Title: Re: LWJGL 2 migration guide to LWJGL 3
Post by: Gunfulker on November 01, 2015, 16:54:36
Can I embed LWJGL3 in awt.Canvas still? Will this be supported eventually?

My GUI is done in swing and I've invested a large amount of effort into it. I want to upgrade to LWJGL3 for the multi-display through GLFW, but that won't matter if I can't put it in my swing because of it.  Is upgrading the right choice for me?

https://www.reddit.com/r/LWJGL/comments/3r1we3/making_a_game_afraid_of_going_too_far_down_wrong/
Title: Re: LWJGL 2 migration guide to LWJGL 3
Post by: spasi on November 02, 2015, 17:34:29
There is no AWT integration in LWJGL 3 and there are no plans to add it later. You can find some old posts in this forum that explain why.

We currently have an open issue (https://github.com/LWJGL/lwjgl3/issues/101) for a GUI solution in LWJGL 3, but it is not a showstopper in any way. We'll gladly accept any robust and low-maintenance solution. Having multiple solutions for different needs is OK too.

Technically, LWJGL 2's AWT integration could probably be implemented in terms of LWJGL 3. If anyone would like to contribute something, I'll make sure any required changes to LWJGL 3 will be accepted (should be few/minor).

I have personally made some progress with an LWJGL-backed JavaFX pipeline, here (http://www.java-gaming.org/topics/placing-a-swing-jcomponent-inside-an-lwjgl-display/36775/msg/350253/view.html#msg350253).
Title: Re: LWJGL 2 migration guide to LWJGL 3
Post by: Gunfulker on November 03, 2015, 04:30:35
That's what I was afraid of. Making one myself is beyond my skill set. My realistic choices are to LWJGL2+swing, or LWJGL3+some GUI library. Before I settled on swing (probably a mistake in retrospect) I experimented with some of these (http://wiki.lwjgl.org/wiki/Game_Engines_and_Libraries_Using_LWJGL#GUI_Libraries).  But if I understand correctly, none of them would work with LWJGL3 currently.
Title: Re: LWJGL 2 migration guide to LWJGL 3
Post by: Kai on November 03, 2015, 09:05:55
I am planning to do what @Spasi proposed: Taking the good and working classes from LWJGL2, which do OpenGL context creation themselves via JNI, and porting them to the native platform API exposed as Java methods by LWJGL3. This should not be too much work, as it is mostly changing the names of referenced exception types and utility methods and classes which moved/changed/have been removed.
Although I would favor a clean solution for context and window creation (whatever "clean" means in this context). But this will distill itself, I guess, from the AWT and coming SWT implementations.
Title: Re: LWJGL 2 migration guide to LWJGL 3
Post by: Cornix on November 03, 2015, 09:53:46
I have been working on a GUI library for about a year now. The library is completely platform independent and thus could be used with LWJGL 3. Unfortunately progress is slow and it is not on the same level as Swing by far. Perhaps I am going to publish it here some day.