java jmonkey engine/lwjgl vs using c++/opengl

Started by
8 comments, last by Aldacron 15 years, 11 months ago
I am currently both fond of c++/opengl and java. My friend and I hope to develope a decent 3d rpg over the next few/several years. I know c++ and opengl are quite powerful, and reasonably quick, however I also cannot ignore the fact that java is available to all OS'. My concern with using java is that utilizes JAR files, and most of the users out in the world, are not familiar with those, and may not feel comfortable running a jar. Theyd prefer seeing good old .exe or a simple zip file that contains the exe. Any input is greatly appreciated. [Edited by - agm_ultimatex on May 12, 2008 6:34:13 PM]
Advertisement
Sounds like you want JSmooth. You can write a java app as normal and package it up in jars. Then you use jsmooth to generate a native windows exe which launches your java app in a nice easy double click.

I use it for windows builds and it works great. For non windows platforms I just distribute a self executing jar (or use Java Webstart) and it doesn't need any code changes at all. [grin]
Ah thanks. I remember hearing about JSmooth a few months back. Any comments on performance differences between c++ and java?
Well I've not had any problems. 90% of the time you're handing the heavy lifting off to the graphics card anyway.
This is true. Hopefully ill figure out what i prefer in a couple months :P
It should also be pointed out that both C++ and OpenGL are multiplatform compatible. You just have to compile it for each platform, but the source code itself can be kept platform independent relatively painlessly by using a library to wrap system calls (such as SDL, Allegro, wxWidgets or Qt).

But if Java suffices for your needs, then by all means, go for it.
-------------Please rate this post if it was useful.
Quote:Original post by Hnefi
It should also be pointed out that both C++ and OpenGL are multiplatform compatible. You just have to compile it for each platform, but the source code itself can be kept platform independent relatively painlessly by using a library to wrap system calls (such as SDL, Allegro, wxWidgets or Qt).

But if Java suffices for your needs, then by all means, go for it.


I am going down the 3d route. Im not sure how much SDL goes into 3d???
I've been doing some of the lazy foo tutorials, its been interesting.

Quote:Original post by agm_ultimatex
I know c++ and opengl are quite powerful, and reasonably quick, however I also cannot ignore the fact that java is available to all OS'.
Any Java you use is, ultimately, going to have to utilize native libraries for the graphics, etc. Basically, you will have exactly the same dependencies using LWJGL or JOGL that you have with OpenGL. It will be no more cross-platform that C++ and OpenGL (which are both perfectly cross-platform).

Quote:Original post by agm_ultimatex
I am going down the 3d route. Im not sure how much SDL goes into 3d???
I've been doing some of the lazy foo tutorials, its been interesting.

Since SDL lets you interface directly with OpenGL, anything that can be done in OpenGL can be done in SDL. You don't use SDL's graphics libray - you use OpenGL instead. There are tutorials of how to set up an OpenGL window in SDL on SDL's webpage. It's very easy.
-------------Please rate this post if it was useful.
Quote:Original post by smitty1276Any Java you use is, ultimately, going to have to utilize native libraries for the graphics, etc. Basically, you will have exactly the same dependencies using LWJGL or JOGL that you have with OpenGL. It will be no more cross-platform that C++ and OpenGL (which are both perfectly cross-platform).


But there's no need to compile the JOGL or LWJGL native binaries for each platform unless you need to modify the source, which is rare indeed. They all come precompiled and ready to go. And when using Java Webstart, you don't even need to bundle the JOGL or LWJGL files with the app or maintain the downloads yourself. They can be pulled from their respective websites automatically and updated in the same way without you ever needing to bother with it. And since the Java source for your app will not be compiled for each platform, there's no platform-specific code to maintain. I think that does score a bit higher for Java in the cross-platform category.

I'm not trying to argue, just pointing out some conveniences in the maintenance and distribution of cross-platform Java apps these days. Distribution used to be my biggest gripe with Java, but it's much, much better now. At any rate, the need to maintain a cross-platform code base is only one of the many issues that need to be considered and probably shouldn't be the deciding factor.

This topic is closed to new replies.

Advertisement