Game Development Community

DX vs. OpenGL

by Grant McNeil · in Technical Issues · 08/10/2002 (5:12 pm) · 22 replies

What advantages or disadvantages does Direct X have over OpenGL?

thanks,
--Grant McNeil
Page «Previous 1 2
#1
08/10/2002 (6:43 pm)
They both have advantages and disadvantages. For the most part it's a matter of personal preference. Because it's personal, it's also a topic that starts some of the most intense flame wars.

Because of that, I'm not going to state my personal opinions at all.
#2
08/10/2002 (10:48 pm)
Well OpenGL has a 3D graphics API, and thats basically it. DirectX has a graphics API (Direc3D), but also includes some other "game related" stuff too, like a sound library (DirectAudio), an input library (DirectInput), etc. DirectX is basically geared towards game development. OpenGL is geared more generally towards graphics.

Both are pretty good libraries, and each has advantages and disadvantages. An advantage of OpenGL is that its a cross-platform open (pretty much) standard, and can be used on many platforms, where as DirectX can only be used on Windows.

An advantage of DirectX is that it includes a lot more stuff, so chances are you won't have to work quite as hard (tho my overall distaste DirectX's API would probably disagree :). An example of that is shaders. DirectX has support for shaders built in, where as they are implemented as (sometimes proprietary) extentions to OpenGL. Also things like sound, with DirectX you pretty much have your sound support there. Using OpenGL you'd have to use a seperate sound library like OpenAL.

_edit_
Oh, another thing about DirectX is that its technology advances quite a bit quicker than OpenGL. Having a big company like Microsoft pushing the libraries to support the latest greates technology can be a good thing, or maybe a bad one depending on who you ask. This isn't really a huge issue, but there are always complaints that OpenGL is too slow to adopt new stuff, like shaders.
_end_edit_

I personally like OpenGL better, but thats mainly because I learned it first, back when DirectX was terrible. DirectX has matured a lot in the past few years, and now has some really nice features that you'd have code yourself, or find a library for, if using OpenGL.

The main reason I still like OpenGL over DirectX these days, is that I can do anything with OpenGL (and a few other libraries like SDL and OpenAL) that I could do with DiretX, but I can't do everything with DirectX that I could do with OpenGL, like run on a platform other than Windows.

If you are programming on Windows, and only for Windows, you'd probably want to use DirectX. If you want your stuff to run on other platforms, you'll be using OpenGL.
#3
08/11/2002 (1:09 am)
well put dave
#4
12/02/2002 (5:10 pm)
And, DirectX is supported by a multi-billion dollar corporation while OpenGL is supported by thousands of independent developers...
#5
12/02/2002 (6:45 pm)
?

OpenGL is supported by Ati, Sgi, NVidia, and several others.
#6
12/03/2002 (3:53 am)
Yes well put Dave :)

It was purely dumb luck that got me to learn OpenGl (eenie meenie miny moe) (is that how you spell it?)... And I think has paid off cause Torque is OpenGL.

I think that OpenGl is much easier in terms of initial implementation (as that is all that I have experienced of Direct3D), but I dont know about all the features and the ease of use of them in DirectX.
#7
12/05/2002 (12:24 pm)
In the RealWorld
#8
12/05/2002 (1:10 pm)
Well put Dave, but it's DirectSound, not "DirectAudio". :)
#9
12/05/2002 (1:41 pm)
Power Render! Need limited knowledge of either! (C: But I'd say study them both, then you'll get a true idea.

Dave suggested some of the most important differences. Adding to that:

DirectX was designed for the purpose of developing games on computers. (Or atleast in its updates it has). OpenGL is just a 3D package for general use. You can see it in DirectX functions (especially network code with DirectPlay) with words like "player" and "game" in the function names.
#10
12/05/2002 (1:57 pm)
OpenGL is cross-platform, DX is not plus it's at the mercy of a company not exactly known for being the nice guys.

I don't know about you, but for me that's all the reasons I need for choosing OpenGL.
#11
12/05/2002 (2:06 pm)
Hi guys, i just want to add that I saw in the realmwars demo that there's an option to choose D3D or Opengl. Torque I know doesn't include D3D rendering, did the RW guys add a D3D rendering all by themselves?
Thanks,
#12
12/05/2002 (2:39 pm)
Microsoft "not exactly being the nice guys" doesn't have anything to do with development. And cross-platform....yeah..it's important..I guess. I suppose if there was more cross-platform stuff out there, then macs would be more successful. But let's face it, consumers are going to buy either windows or get a mac because linux just isn't user freindly. And if they want to be able to run more than movie-editing software, they'll get windows. And why is that? Cuz developers like to develop for windows..more money, and better development tools. Sorry to say it, but Microsoft is a bit of a "necessary evil". (Except for XBOX..bleh!)
#13
12/05/2002 (6:48 pm)
Torque allows for OpenGL or Direct3D in the source code base.

Also, the network code that is provided by DirectX, called DirectPlay has proven pretty useless for anything more complicated than a checkers game.
#14
12/05/2002 (11:00 pm)
Jeremy: It does. I've been in a company that went belly up because they bet the farm on a) the wrong software, b) developed by the wrong people. So maybe I'm over-sensitive.

However, Microsofts less than bright past does have to do with development, namely the fact that they can and will switch things around right under you if it suits their purpose. In the worst case, that can throw you back several months. In a competivite industry, that means the end of your project. For most smaller companies, it will be the end of the company.
For part-time developers or hobbyists, that may be an acceptable risk. However, if I were (I'm currently not) responsible for a dozen people and that they can pay their rent, I couldn't take a risk like that.
#15
12/06/2002 (9:11 am)
Yeah, I mainly code in OpenGL simply because I do both Linux and Windows programming so its not a tough choice for me to make. Not having to rely on Microsoft is just an added bonus :)

I've learned both simply because, like Jarrod said, its good to know both. I don't really miss much of the "extras" of DirectX since I can use other (cross-platform) libraries to replace all the stuff like DirectPlay (which IS worthless), DirectInput, and DirectAudio. Oh, and it is actually called DirectAudio, there are two parts to it called DirectMusic (High level) and DirectSound (Low level). I don't really use them, so I'm pretty much only going off my reference material here.
#16
12/06/2002 (9:28 am)
Good points Falcon. I thought you were just stating that you don't like microsoft and that is reason enough. But you have some very valid concerns for development.

At the same time, Microsoft may be greedy and stuff, but they aren't stupid. They wouldn't change things so abrubtly as to eliminate compatibility with something that people are currently working on. I assume you are referring either to a new version of DirectX changing things or a new version of Windows that doesn't support DirectX the same. All realeases of Windows have been rehashes of the same thing with more bugs added, I think we can all agree, so Microsoft won't change anything so drastically in their development tools that would essentially kill a project. It is bad business, and you gotta admit, Microsoft must have a pretty good business sense (not ethic) to be as successful as they are.
#17
12/06/2002 (11:02 am)
"They wouldn't change things so abrubtly as to eliminate compatibility with something that people are currently working on."

One needs to look no further than the Java VM issues with Windows XP to disprove that statement.
#18
12/06/2002 (11:42 am)
Yeah, Java VM got removed from windows. Personally, I think that was a weakness in Java. I know they were looking for cross platform capability with unicode interpretation, but that causes a dependency on the Java VM that a lot of different companies didn't want to support (not just Microsoft). There's gotta be a better way... Besides, people knew that Java VM support was going to be removed before XP even came out. No developer worth his ass would have been putting the life of his project or company on the line for Java VM support.

But it doesn't matter, we were talking about DirectX vs OpenGL. I wasn't making a general statement about Windows's suport with every imaginable package, just windows and DirectX. And those two will be inseperable for a long time. Keep an eye out for DirectX 23 in 2065!
#19
05/29/2003 (11:08 pm)
Be sure to compare apples to apples. If OpenGL is an apple, DirectX is a television set. A meaningful comparison is D3D to OpenGL.

Right now, there are a few pressing issues. D3D is likely to be CPU-limited on many projects due to batch limitations (<500 per frame). D3D supports one code path on modern hardware, whereas OpenGL currently requires you to write two. OpenGL is cross-platform.

This issues are a bit more complex than I have sketched them, too, but I am not going into any more detail. Instead, I would recommend picking one at random and learning all you can about it, and never regretting your decision. After you become a sharp with one, the other is mostly cake. Right now, understanding the hardware is of higher commercial value than knowing the API back and forth. (I would rather hire an OpenGL guru who knows shaders back and forth than a D3D7 pro who has never used anything more complex than modulate.)
#20
05/29/2003 (11:31 pm)
This thread is dead.... [HOW]-Ed :)
Page «Previous 1 2