porting from JOGL to LWJGL

Started by BrickFarmer, November 06, 2010, 17:47:27

Previous topic - Next topic

BrickFarmer

I have a large JOGL code base I'm considering porting over to LWJGL.  Are there any tools to help with the migration?  Or documentation? Are there equivalents for things like:

import com.sun.opengl.util.awt.ImageUtil;
import com.sun.opengl.util.texture.Texture;
import com.sun.opengl.util.texture.awt.AWTTextureIO;


Is LWJGL stable and fully supported on the Mac?  
How about cross-platform webstart? applets?
Does LWJGL integrate best with any specific IDE?
Maven2 support?
Is there some work ongoing to allow code migration towards WebGL?   ie the Google stuff that was kicking around earlier this year.

Sorry for so many newbie questions, but it's a big project, and I don't want to take a step in the wrong direction.


Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon

kappa

Quote from: BrickFarmer on November 06, 2010, 17:47:27
Are there any tools to help with the migration?  Or documentation?
Don't think there is but its not that different, both a basically opengl bindings so there are only small differences.

Quote from: BrickFarmer on November 06, 2010, 17:47:27
Are there equivalents for things like:

import com.sun.opengl.util.awt.ImageUtil;
import com.sun.opengl.util.texture.Texture;
import com.sun.opengl.util.texture.awt.AWTTextureIO;

Yes there are, you should look at slick-util, see the lwjgl faq on the wiki on how to load images and sounds.

Quote from: BrickFarmer on November 06, 2010, 17:47:27
Is LWJGL stable and fully supported on the Mac?  
yes

Quote from: BrickFarmer on November 06, 2010, 17:47:27
How about cross-platform webstart? applets?
LWJGL is cross platform and works fine as both webstart and applet. see http://www.lwjgl.org/applet and the demo's page for examples of this.

Quote from: BrickFarmer on November 06, 2010, 17:47:27
Does LWJGL integrate best with any specific IDE?
Maven2 support?
Don't think it does integrate best with a speicfic IDE but there are some plugins for eclipse and netbeans. Generally though you should be able to set it up on all java ide's. Maven2 support isn't provided officially but there are ppl that use lwjgl successfully with maven.

Quote from: BrickFarmer on November 06, 2010, 17:47:27
Is there some work ongoing to allow code migration towards WebGL?   ie the Google stuff that was kicking around earlier this year.
not that i'm aware off.

BrickFarmer

Thanks for the detailed and quick response!

A few more things I spotted in my code that might trip me up:

import com.sun.opengl.util.awt.TextRenderer;

Also how is the integration with Swing? 
I read someplace that LWJGL has a native windowing option too?
Keyboard and mouse listeners gonna cause me trouble?
Fullscreen mode supported?

The more I look at my code base, the bigger job this is feeling.  Even things like switching from gl.glSomething to GLnn.something looks tricky, ie. knowing which methods are defined in which class (they don't extend it seems?).

Not really relevant to my current task, but is it possible to develop against ES2 on the desktop (mac)?
Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon

kappa

Quote from: BrickFarmer on November 07, 2010, 15:16:33
Thanks for the detailed and quick response!

A few more things I spotted in my code that might trip me up:

import com.sun.opengl.util.awt.TextRenderer;

Also how is the integration with Swing?  
I read someplace that LWJGL has a native windowing option too?
Keyboard and mouse listeners gonna cause me trouble?
Fullscreen mode supported?
- Yes LWJGL can be embedded in swing.
- As for Native Window, yes LWJGL has this option and is the main way to use LWJGL.
- LWJGL's native window has its own Keyboard and Mouse input support, which is better then AWT as its has lower latency, so more suitable for games.
- Fullscreen is supported.

Quote from: BrickFarmer on November 07, 2010, 15:16:33
The more I look at my code base, the bigger job this is feeling.  Even things like switching from gl.glSomething to GLnn.something looks tricky, ie. knowing which methods are defined in which class (they don't extend it seems?).
Try Java's static import feature, that way you can just import the whole lot and not worry about which method goes where, see LWJGL's faq for a slightly more elaborate answer.

Quote from: BrickFarmer on November 07, 2010, 15:16:33
Not really relevant to my current task, but is it possible to develop against ES2 on the desktop (mac)?
OpenGL 4.1 is supported by LWJGL which has some sort of compatibility with OpenGL ES which could be used. Other then that I hear there is a LWJGL ES version in the works which should be out soon and will allow this.

jediTofu

Quote from: kappa on November 07, 2010, 17:43:35
- Yes LWJGL can be embedded in swing.

Is there an example of doing this somewhere?  I assume it has to deal with using Canvas like for Applets.
cool story, bro

kappa

Quote from: jediTofu on November 07, 2010, 19:41:36
Is there an example of doing this somewhere?  I assume it has to deal with using Canvas like for Applets.

You can do this using Canvas and Display.setParent() (like applets) or you can use AWTGLCanvas.

But if you ask me i'd say avoid Swing, its not very nice to use with OpenGL and not optimal for performance, your better of using the native LWJGL Display and an opengl gui library like TWL which should allow you to do most things that you can do with Swing.

BrickFarmer

Is the Swing compatible option hardware rendered still?

What about TextRenderer, anything similar for nice outlined fonts.  I found some old info here about bitmap fonts, is that still the only option?
Oculus Rift CV1, MBP 2016 - 2.9 i7 - Radeon Pro 460  OSX 10.12.4,  Win7 - i5 4670K - GTX1070.
Oculus Rift VR Experiments: https://github.com/WhiteHexagon

jediTofu

Slick-Util is the suggested library for loading images and sound.  It also has built-in support for drawing Fonts in OpenGL.  It uses java.awt.Font, so you can only load a font file I believe (java.awt.Font.createFont(...)).

http://slick.cokeandcode.com/downloads/util/
http://slick.cokeandcode.com/wiki/doku.php?id=loading_and_binding_opengl_textures_with_slick-util
http://slick.cokeandcode.com/javadoc-util/
cool story, bro