LWJGL & swing

Is there a way to put an OpenGL context (with LWJGL) in a swing component ? It would be very usefull for making a game editor…

++
Chman

AFAIU, LWJGL only allows a single, self-made window. Nothing else.

oh… so there’s really no way to put an opengl context in a java component ? so how can i build a game editor ?

++
Chman

gl4java, Java3D

Or wait until they come up with a LWJGL-GUI lib.

I’d suggest to call the one-and-only window ‘JFrame’ then, the basic GUI component could be named ‘JComponent’, specialized via ‘JPanel’ to ‘JButton’.
etc etc…

;D

LWJGL creates its own windows instead of using a provided hWND. Because of this it is fairly standalone since the original intention was to have no dependencies on the AWT or other graphical APIs.

To make a change that does otherwise woudl violate the design paradigm of LWJGL and require linking with the JNI-AWT libraries and I don’t think Cas wants to do that.

'srite.

There’s Swing, AWT, and GL4Java for those that need that kind of functionality. LWJGL is about turning your pooter into a blank canvas running a JVM.

Meself, I’ve got my own GUI system working nicely in LWJGL and to my mind it’s far more useful than Swing for games.

If you’re really desperate to soldier on with LWJGL against its design paradigms though, the source is there for all to see and tweak…

Cas :slight_smile: