Jump to content
  • Advertisement
Sign in to follow this  
Si Hao

[java] Java2D or JOGL

This topic is 4444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am currently making a simple clone of Dungeon Siege. The difference being my game has a 2D top down view instead of full 3D and players only control one character at a time. What I am doing is to create a simple functional game as a learning process, before improving upon it gradually. For example changing from top down view to full 3D. Here is the question, should I use Java2D to do my rendering now as it is easier, but will need a code rewrite when I convert my game to 3D, or should I use JOGL for rendering while learning it in the process. Any advice is appreciated.

Share this post


Link to post
Share on other sites
Advertisement
The point that really requires a thought is how are you going to model your game logic, having that switch of rendering technology in mind. You must concentrate first in a good set of interfaces and abstract classes to provide the functionality you require from your game objects, but keeping them uncoupled from a rendering interface. If you achieve that, you are free to adapt your code to whatever rendering interface you please: Java2D, JOGL, or.. LWJGL :p

So my advice to you is: before you even wonder if you should use 3D from the beginning or not, worry about building a consistent and flexible design for your game objects. A hint of a good work is the presence of interfaces such as Collideable, Localizable, Movable, Drawable, etc.. You can work with abstract terms in code, and switch only the concrete rendering layer when changing from 2D to 3D.

Son Of Cain

Share this post


Link to post
Share on other sites
Thanks for the replies.

I have been trying to keep my code as flexible as possible, thanks for bringing up more things to consider :)

Guess I will stick with Java2D first and only go into a new API when I iron out all the bugs and design issues.

Share this post


Link to post
Share on other sites
Java2D can run with hardware acceleration in Java5, so speed isn't an issue. I've used Java2D for a lot of things. It's definitely a good API to learn, I use it all the time at my current job. Additionally, you won't have to include any 3rd party dependencies in your app, the JRE comes with Java2D (not the case with JOGL, or JSR-231 as it's now called).

Share this post


Link to post
Share on other sites
Quote:
Original post by princec
"Available" != "widely distributed"

Cas :)

Actually, it's distributed as an OS Update, pretty much everyone on OSX should have it. However, the same relationship can be made for OSX...

Share this post


Link to post
Share on other sites
Sadly completely untrue :( For a start it only runs on 10.4+, and most of the OS X visitors I get are using 10.3 or even 10.2 still. In fact I've got some actual real stats here... let's see... here's the stats for the last 3 months:

1.4 18049 84%
1.5 3384 16%
1.6 1 0% (haha)

So there you have it. Will be a few years yet before it's sensible to target 1.5 for games dev.

Cas :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!