[java] To use OpenGL or DirectX?

Started by
12 comments, last by Lucidquiet 18 years, 6 months ago
I'm pretty new to the game developing world (excluding text-based browser games). I think I'm ready to evolve into something a bit more so to speak. =) Was wondering if I should use OpenGL or DirectX for Java 3D Programming? Like the cons, pros, etc. Yes, Google was a friend, but didn't find enough information to exactly go on one's side (by a lot anyway).
Advertisement
EDIT: Oops, didn't see the Java bit, so what I say may not apply. I know nothing about DX implementations for Java.

I haven't used DX much, but I think these points are worth considering...

OpenGL

Pros:
. Little initialization, so creating apps is easy
. NeHe's tutorials are great for beginners

Cons:
. The nature of the ARB board and Extensions mean that using new technologies can be difficult and confusing
. No SDK

DirectX

Pros:
. Everything you need is in one package
. The SDK comes with some extremely useful examples, especially of some of the more advanced concepts

Cons:
. Initialization can be long and confusing

[Edited by - MumbleFuzz on October 11, 2005 5:25:59 PM]
MumbleFuzz
Just before this thread totally degrades, I want to doubly bring attention to the fact that he is using java, which throws a bit of a wrench in things.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
For Java, you say? I'm not aware of any Direct3D bindings for Java, so your choice of language limits you to OpenGL (unless I'm wrong, in which case, please point that out.) There are a few ways to use OpenGL in Java- the best I've come accross is LWJGL. I'm using it for my current project, and I'm very happy with it. Bear in mind that the documentation is a work-in-progress, though.
the rug - funpowered.com
A second recommendation for LWJGL. Given that functionality-wise they're identical, and you're already writing cross-platform java code, why tie yourself to windows by using DX?
I've seen a demo of a Java program that used Direct3D for graphics, so it is possible, just not very common. On the whole you'll find far more resources for using OpenGL with Java than you will Direct3D, so if you don't already know both Java and Direct3D like the back of your hand then I'd say go with OpenGL.
My company used to have a Java3d engine. I beleive Java3d had DirectX and OpenGL libraries 2 years ago, however you werent directly using either one, rather the Java3d scenegraph. And the directX version was even buggier than the OpenGL version.

Not too useful, but I thought I'd also mention I've seen DirectX sort of exist in Java.
Quote:Original post by draginx
Yes, Google was a friend, but didn't find enough information to exactly go on one's side (by a lot anyway).


Which should tell you all you need to know, if you think about it. The reason they both exist is that there is no "best" choice. Now, I have no clue how they work with Java, or even if both are possible to use with Java, but no, there is no simple answer or "best graphics API".

Some people prefer OpenGL (it's not object-oriented, which some people prefer, it's easy to set up and initialize, it's more portable as an open standard)
Others like DirectX (Object-oriented, big SDK with everything you'll need, limited to Windows, updated regularly, well documented)

And some just use whatever they're told to use.
The thing is they both provide hardware accelerated 3d graphics, so they both get the job done. Pick whatever works in Java, and whatever you like the best.
To be honest, this is likely to be better answered by a group of Java people than a group of Graphics people, so I'm moving this to the Java forum.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

A wise move, but I expect he's lost the post now :)

OpenGL all the way for Java. There are no Direct3D bindings.

Cas :)

This topic is closed to new replies.

Advertisement