Window toolkit

Started by Chman, June 16, 2003, 15:36:54

Previous topic - Next topic

Chman

Hi everybody !
I know that this question has ever been asked, but maybe I will have a different answer...
Will lwjgl be integrated into an awt/swing panel ? Is there a way to do that ?
Because I'm planning on a little 3d editor, but making it only using opengl will be a very very long & hard task... And I don't want to switch again to GL4java cause I love LWJGL ! But if I haven't the choice.......

So can someone help me ? Does anybody has ever tried to put lwjgl in a AWT application ?

++
Chman

princec

The short answer is: no, you can't.

The long answer is: no, you can't, and never will be able to. LWJGL is a complete replacement for AWT. Even if we did some clever hacks to it to put it in an AWT window it still wouldn't work because the whole design is based around the LWJGL window.

What you'd end up with is JOGL :)

Having said that: we're going to change LWJGL to use Buffers instead of ints, and give the GL commands their gl prefix once more, and make all the methods static in preparation for JDK1.5 and static imports.

What this means is that your code should refactor between JOGL and LWJGL very easily.

Now - I'm of the opinion that making a little 3D editor using only OpenGL isn't quite so hard as you might think. In the relatively near future I'll be open sourcing the GUI code from Alien Flux and putting it into the SPGL, which is half the work already.

Cas :)

Chman

Thanks for your very quick answer !

Concerning the full OpenGL editor, it wouldn't be so difficult, I agree, but I'm not sure it would be as efficient as a classical editor in a window...

Thanks again, nervertheless I will try to make it entirely with lwjgl !

Chman

princec

With the new support for hardware cursors that Elias has added, there's no need to paint the entire screen every frame. You could do a really simple damage/paint list and just redraw those components that need to redraw.

Cas :)

psiegel

Would it not be possible to have two separate windows, one using Swing with all your tools (buttons, text boxes, etc.) in it and another LWJGL rendering window to show your output?  The LWJGL window would have to do some good picking and report back to the main running class, which the Swing thread could query either at a regular interval, or when it detects user input.

That said, I'm curious if it would be conceivable to implement glut in LWJGL.  I don't have a ton of experience with glut myself, but perhaps it might be a very approachable way to do windowing/gui stuff.

Paul

Chman

Yeah implementing glut would be great !
Let see what Princec think about that...

jbanes

Quote from: "Chman"Concerning the full OpenGL editor, it wouldn't be so difficult, I agree, but I'm not sure it would be as efficient as a classical editor in a window...

Maybe you have a special reason, but I guess I should probably ask before you run off an develop a 3D editor. Have you tried MilkShape3D yet? It's a really great low poly editor with an easy to parse file format.

Chman

I know milkshape 3D, but I want to make a Level Editor, not a 3D model editor (sorry, it's my fault :))...

jbanes

Heh. No problem. Just thought I'd mention. Along the same thread, you may want to check out the modelers for other games first. Quake, Unreal, Half-Life, insert your favorite game here, all have modelers that, depending on what you're doing, might be able to do the job just fine. I think that some of them are even OpenSource and could be modified to your needs.