Which OpenGL wrapper?

Hi all.

I’m trying to pick up OpenGL, and ended up reading these forums.
I have a little experience with D3D from before, but OpenGL seems to be the way to go using Java, which I’m a lot more comfortable with than icky C++…

Thing is, I’m having a hard time picking a library. There’s j3d, jogl, lwjgl, gl4java, +++…

Ideally, I’d like to do immediate mode, active, rendering. No sluggish, inflexible scenegraph stuff. :wink:
In case I have no idea what I’m saying; something like this:

while (renderingThread != null) {
positionCamera();
drawStuff();
flipDrawingSurface();
}

…but if that isn’t how it works here in GL-land, I guess I’ll have to adjust.

I don’t need a lot for starters - just a full-screen triple-buffered display that will let me draw a few indexed primitives. I imagine I’ll be looking for full extension-support and decent performance in a while, though.

Any feedback appreciated. Sorry if this is OT - not really about jogl, I guess.

Sounds like ‘pure’ OpenGL is what you’re after then, which basically gives you the choice of LWJGL, Jogl, gl4Java and the SWT OpenGL binding.

gl4Java is pretty much outdated now, so you can scrub that off your list. SWT binding I have no idea about, but if you’re planning on using SWT widgets anyway it might be worth looking into.

LWJGL gives you single-display as standard, and is a snap to get running. Jogl will ask you to jump though obscure hoops to get it to work, and is generally less compatible but does allow you to use the display in a Swing GUI, which may or may not be important. Either is probably sufficiant, but IMHO general support and stability (especially fullscreen support) makes LWJGL a better choice.

LWJGL, definitely :slight_smile:

Cas :slight_smile:

Can’t resist…now that we have each technology on JGF auto-linked to the games that use it, visit JGF (address below) and go to the technologies page and have a look at the games done in each tech. That should help you get an idea of what other people managed to do with each. Although I suspect you’ll end up merely thinking "they’re all about the same, it might help somewhat.

I think JOGL is great and it seems to be the future until JSR 231 gets rolling. Of course, that is just my opinion.

I would think that most people here would agree as this is the JOGL forum.

JOGL, definitely :slight_smile:

[quote]JOGL, definitely :slight_smile:
[/quote]
We dont have any techs listed for Wurm on JGF, so if you could tell me what other ones you’re using I’ll add JOGL and them too…

Don’t make it a religious thing… Support both!
LWJGL & JOGL!

http://www.auriga3d.org/

:wink:

BOF 2122 @ J1

JOGL (for my current developmental work applications)
LWJGL (for my mini games projects)
JInput/FMOD - haven’t tried yet
gl4java - all my old time projects from yester-year.
j3d - never
xith3d - never

[quote]Don’t make it a religious thing… Support both!
LWJGL & JOGL!

http://www.auriga3d.org/

:wink:

BOF 2122 @ J1
[/quote]
…email me the details for JGF (ceo @ grexengine.com) and we’ll add a page for Auriga. Don’t have a handy list of all the possible options for techs at the moment, but if you browse the current tech pages you should end up seeing all the different things we have (auto-generated, so e.g. JInput has an HCL but no-one’s given us any data to do one for JOGL, so the JOGL page doesn’t have an HCL link).

Also, if you send me the details for any games using Auriga (don’t have to be gold - just playable) - details to send are linked to from front page - then we’ll get them up and showing up in the Auriga section.

The appropriate OpenGL wrapper depends on your needs.

If you are designing a multiple OpenGL view application, e.g. a scientific application, you can not use LWJGL, because it only supports a single window. In that case Jogl could be interesting for you.

If you are afraid of the OpenGL state machine you may want to take a look at the object-oriented wrapper Xith3d.

I’ve made the experience that it is a little bit easier to port C coded OpenGL to Jogl than LWJGL, because the Jogl signature is closer to C API for some methods:
Jogl: void glGenTextures(int n, int[] textures)
LWJGL: void glGenTextures(java.nio.IntBuffer textures)

But generally the pure OpenGL part in an application is small compared to all the other code. Therefore I suggest to decouple the application from the pure OpenGL by introducing appropriate interfaces which are realized by Jogl or LWJGL. Even if you would realize the interfaces with both wrappers, Jogl and LWJGL, this development overhead might be small compared to the total development efforts of your project.