Ok, I'm new to the whole Java gaming scene so humor me. (I am, however, an experienced enterprise Java programmer.) What's wrong with GL4Java? In other words, why LWJGL? I've never used either binding, but I've seen some pretty neat demos done with GL4Java. I've also heard some scary things about LWJGL (direct memory access through pointers in Java!) Also, GL4Java is available for multiple platforms whereas LWJGL (at the moment) is not. What's the deal? Where is GL4Java's fatal flaw?

Also, GL4Java is available for multiple platforms whereas LWJGL (at the moment) is not.

LWJGL is available on Windows & Linux - Mac OS X is in the works, but until Apple releases 1.4.x that version is being stalled.

Quote

What's wrong with GL4Java?

`This perhaps?

1

Version2.8.2 - Release0 - 11th December2001

Or just the simple fact that GL4Java is about OpenGL for Java (incedently), where as LWJGL is about creating a barebones library for accessing the required HW to do games (graphics, sound, input & vector math for 3d operations)

Quote

I've also heard some scary things about LWJGL (direct memory access through pointers in Java!)

When I say "scary", I don't mean that I'm scared of pointers. I started out as a C programmer. The scary part is that pointers defeat one of Java's primary design goals. Java programs are intended to run in a strictly controlled environment. Giving programs unrestricted memory access is not something that I find acceptable for a Java program. It will certainly never be supported by Sun.

We don't give programs direct memory access, we only give them opaque integer handles. They just happen to be pointers but there's no way to use them as pointers from Java. Your code is safe You can still crash the VM and cause all sorts of mayhem by getting it wrong but there's very few places in OpenGL that write back to client memory so you just have to keep them watertight.

We would have stuck to using DirectByteBuffers instead but discovered there was a significant overhead calling GetDirectBufferAddress which added up to a large overhead during the course of a typical video frame.

But the key crucial difference is:

- if you want to write OpenGL games that use windows, AWT controls, or even Swing widgets, and are fractionally less concerned about frame rates and the very latest features, you need GL4Java.

- if you want to write the lowest-level, fastest code around and want to write full-screen game applications using the latest technology without the help of the AWT, LWJGL is for you. LWJGL turns your computer into a console running a JavaVM, no less. By only a short stretch of the imagination we might get it ported to something like PS3 pending some OpenGL drivers. Put that in your pipe and render it!

There's a bunch of useful bits of code in my Shaven Puppy Game Library too, for stuff like creating textures and the like. Maybe the most useful stuff in there is the font rendering and converting code.

You've got to remember that with LWJGL you basically don't/shouldn't have access to any AWT classes - which sadly includes BufferedImage and ImageIO and all their little friends like Points and Rectangles and Dimensions - so you've got to have something in their place.

Having opaque pointers, like we have in lwjgl, does indeed support the Java Security Model - we are aware of that. But the purpose of lwjgl, isn't to be a general purpose java library - like the Collections class, but more of a direct route to the HW. If you want to go the "Java way" by all means use Java 3D, however if you want the job done, without all the fuss, lwjgl is the library of choice for high performance graphics and indeed sound.

Well I don't want to go bashing the Sun folks - they've done good stuff in the past. They just never really aimed their work at gaming and apparently never surveyed game developers when building their game oriented solutions.

I'm sure they're getting a lot of good feedback, and if they're smart - they're looking at how to promote LWJGL as a Sun solution the same as they do all of the Apache stuff. It would be 'unfortunate' if they went off and tried to keep up with us on their own. We'll toast them easily

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org