Archived

This topic is now archived and is closed to further replies.

airbug

[java] Java for 3D game development

Recommended Posts

I''ll give a try to Java for some game development. I''m considering using a OpenGL binding for Java. So far my research yielded that the two alternatives lwjgl and jogl. (I''m not searching for a engine or a scenegraph, so I''m not considering Xith3D.) I got the impression that jogl is semi-official. However lwjgl seems quite good. lwjgl also has OpenAL bindings and input bindings, which are nice. So what do you think? Should I use lwjgl, or use jogl - joal - jinput combo?

Share this post


Link to post
Share on other sites
The most important question really is, do you need to embed the OpenGL canvas inside of a Swing/AWT window, or are you happy with it floating totally separate. Jogl will let you do the former, as LWJGL deliberatly doesn''t need AWT to create its display. The upshot of this being that LWJGL is more reliable and has fullscreen mode that actually works. I use Jogl for V-Script/S-Type because I needed a pretty comprehensive editor and so wanted to use Swing as well.

Joal is still somewhat unstable, as is JInput, again you''ll get much more reliable behaviour with LWJGL. IMHO, go with LWJGL unless you''ve got a really compelling reason to choose Jogl.

[S-Type] [V-Script]

Share this post


Link to post
Share on other sites
I second that. You could also abstract so that you can support both. I''m doing that with an open-source project I''m developing right now, although I would prefer to stick with LWJGL. The reason for this is that I want to create a world editor using the engine''s renderer. Using LWJGL, I''ll most likely be stuck making an in-game editor, which I don''t want. JOGL allows you to make an independent AWT/Swing editor since it is built around AWT/Swing components. Someone outside of the LWJGL team is working on SWT support for LWJGL, and if that ever makes it to the core distribution then there''s another option.

Share this post


Link to post
Share on other sites
quote:
Original post by OrangyTang
Of course theres nothing stopping you making an editor with floating toolbars next to a LWJGL window, or you can just embed the whole thing within the game like I did here.



It''s all a matter of preference. I find apps with floating toolbars rather annoying, particularly when running other apps at the same time. And I think simple in-game editors are fine (Railroad Tycoon or Lords of Magic for example), but for something rather complex I don''t think it''s the best soluttion (the Torque engine for example).

quote:
Original post by princec
A clever bunny could even implement LWJGL in terms of JOGL, should they feel so inclined.



If you mean adding AWT support to the native LWJGL side, that''s something I had not considered. Hmmm.

Share this post


Link to post
Share on other sites
I''m already thinking of doing this to get it to work properly on MacOS X. MacOS X is handy because it comes with the JRE built in to it. The problem on Windows was of course the lack of a JRE and the subsequent hassles trying to deploy the huge AWT and Swing-laden JRE with every crappy game. The LWJGL set out to be independent of the JRE to allow JetPerfect compiled apps and other tricks to keep the size of games down to acceptable levels.

So yes, an AWT port is probably on the cards whatever.

Cas

Share this post


Link to post
Share on other sites
Yes, I''ve been following LWJGL development for a while. The lack of AWT/Swing dependencies is one of the reasons I prefer it over JOGL. In face, in the engine I''m working on over at java.net I''ve kept AWT references out of the core interfaces so that they need not show up in the LWJGL implementation. Just to keep everything AWT-free for those who want to use LWJGL for that reason.

I''ll have a look through the JOGL sources and over the next couple of weeks see if I can get something up and running.

Share this post


Link to post
Share on other sites