views:

269

answers:

2

What is the difference between OpenGL and Direct3D? Are they truly different implementations to accomplish the same things (like Java and Mirosoft's CLR [.NET])?

+2  A: 

Google is your friend in this case...there's a good Wikipedia article contrastring the two libraries:

Comparison of OpenGL and Direct3D

If memory serves, OpenGL was the open implementation before Direct3D came out. Direct3D was then based off of OpenGL...but quickly diverged and became it's own distinct library.

UPDATE

Looks like my memory is shot...

Direct3D was developed independtly of OpenGL.

Justin Niessner
Direct3D wasn't based off of OGL (though they both used the same basic model for rendering.) The history of D3D before 5.0 is definitely weird (http://en.wikipedia.org/wiki/Direct3D#History).
Michael
Good point on Google.
Frank V
Heh - I worked on Direct3D before it became Direct3D ;-) Definitely not based on OpenGL...
Steve Lacey
Can't argue with that.
Justin Niessner
+6  A: 

They are very different graphics API's. But it's fair to say they mostly accomplish the same thing. DirectX is probably the API of choice if you are developing a game under windows (or a game for XBOX), and OpenGL is the choice if you want cross-platform support. Mac OS uses GL, as does the iPhone, for example, and many windows games also support OpenGL.

Because OpenGL was developed over a long time and 'by committee', it comes with a lot of baggage - the API has some older options that aren't really relevent today. That's one of the reasons for OpenGL ES; it cuts out all the junk and makes for an easier target platform.

DirectX on the other hand is controlled by Microsoft, and as such it has a more 'modern' feel to it (it's based on COM components, so is highly object oriented). MS often update the API to match new hardware.

Sometimes you don't have the luxury of choice (iphone for example can't run DX). But often it just comes down to personal preference/experience. If your a long-time graphics programmer, you tend to get pretty familiar with both...

cmaughan
Thank you for the detailed explanation. that gives me a very clear picture of the two.
Frank V