🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

OpenGL Vs. DirectX... Which is better?

Started by
8 comments, last by AcidJazz 24 years, 7 months ago
Both are kewl API's. If you want to write portable code, use OpenGL, if you wanna write for Win9x systems, use DirectX. That's it. (IMO)

CU

------------------
Skullpture Entertainment
#40842461

Graphix Coding @Skullpture Entertainmenthttp://www.skullpture.de
Advertisement
Not quite sure because i havnt looked into opengl much latly. But doesnt opengl not have code for input,networking,and sound?
Well first we have to clarify that OpenGL is not the same type of API as DirectX. It is strictly graphics, whereas DirectX can handle sound networking input and graphics. So the question really is OpenGL vs DirectDraw/3d.

Here is my 2 cents on it all (no actual cash value)
DirectDraw/3d (on its simplest level) sets up an environment that is similar to what VGA programming used to be. You can gain (pseudo)direct access to video memory so that you can manipulate it directly. This is the only thing that I see as a major difference because past that both DirectDraw/3d and OpenGL contain transfomration and rasterization functions.

OpenGL is (IMO) more clean and easier to learn.

Both API's are acclerated to the point that the real 'benchmark' relies on the job programming. Which is to say don't pick one or the other because you've heard one is faster (that point can be debated forever).

Also relaize that OpenGL can be used wih DirectAccess/input/sound so they really shouldn't be a factor.

essentially you have to use both and pick your preference.

[This message has been edited by menasius (edited October 24, 1999).]

-menasius"Quitters never win...winners never quit...but those who never win and never quit, are idiots"
The other thing to keep in mind is that the level of support for OpenGL by Graphics card manufacturers is lacking. Many cards only handle a small subset of the API (mini-drivers), while some don't support it at all.

Direct3D on the other hand, is supported by nearly every card on the market. Some capabilities might not be, but what the hardware doesn't handle DirectX hardware emulation does.

Also, the implementation of OpenGL you choose is a factor. For example, they say the windows implementation is quite slow.

I've not had much experience with it, but the little bit of research I've done has led me to the descision that now is not the time to use OpenGL exclusively. Not for games anyway. It would be great for modelers (I believe 3DS Max uses it).

Word is, however, that things are looking up and more hardware support for OpenGL will increase in the near future.

One more thing. As far as the learning curve goes, the new Direct3DX utility library that ships with the DirectX 7 seems to simplify D3D. Much easier now than using Immediate (or even retained) mode. And a new D3D interface called Fahrenheit is on the horizon (last I heard).

[This message has been edited by Aldacron (edited October 24, 1999).]

Really you should compare Direct3D and OpenGL.

Each has it's advantages and disadvantages. Here is a breakdown of them.

OpenGL - Designed by a committee, inclusion of new features to the common API is slow, but deliberate, so features are fairly logical and clean, they just take awhile to be included.

However, OpenGL supports extensions that can expose additional features, but of course you have to code the usage of extensions into your game/program.

Assuming you are using a full ICD, you cannot determine what is supported by the hardware, and what will be emulated. Also many cards have lackluster drivers that do not support most features in a good way.

Direct3D - Rapidly adds new and upcoming features, which is good, but the API itself has gone through a number of overhauls.

Drivers for most cards are relatively decent, and you can tell through caps bits what a card supports, but to some, the "caps" system is a bit much.

OpenGL tends to be easier to use, but in my opinion isn't that great for games, for some of the reasons I mentioned above, and also one of OpenGLs main strengths is that it is portable, but considering a game written for Win32 will almost by default use nearly every other component of DirectX, the game itself really isn't portable.

Well, the OpenGL implementation for some cards might be sluggish (older cards don't even have a driver), but there are some tools that can help your gamer. Scitech has a library that translates OpenGL to DirectX, and there is a freeware version included in the new Mesa 3.1 distribution. That should take care of the compatibility problems. Question is, if these are slow. I didn't try them out, but I have some questions about their speed if they have to translate form API to API to API to hardware.
hahahhahaha
The choice between OpenGL and Direct3D really depends on a large number of factors.

If you are relatively new to programming or graphics programming, then I would OpenGL would be a better choice as it requires minimum code to initialize it and has a much cleaner interface.

If you are familiar with Windows programming then learning D3D will not be as big of a challenge.

As Menasius pointed out, speed between them is not a reason to choose one over the other.

OpenGL drivers for video cards are currently much better than the previous posts suggest. Unless you haven't purchased a new video card in the past 18 months your card will have an OpenGL ICD. 3dfx cards are the exception, but even they support a very large subset of OpenGL (enough to run Q3A) and this encompasses nearly everything a game programmer would need (especially a novice one).

Direct3D is just as robust as OpenGL is, but it will take substantially more effort to get up and running.

This is turning into a long post so I'll just add one more point. This is the time when OpenGL is a viable solution as the only 3D API for a game as Q3A, Diablo II, and Halo will all have OpenGL versions but not Direct3D.

I didn't mean this to turn into a pro-OpenGL message, but it did help remind me why I use OpenGL instead of D3D for my personal projects.

What are the differences between the 2? What can you do with OpenGL that you cannot do with DirectX? And vice versa?
Why is 99% of the Comp Sci population guys, and the other 1% not female? ;/
I would look at the way you init OpenGL and Direct3D as an example of which is better. With D3D, you write a bunch of potentially buggy enumeration functions, and then create all of these "device objects". It took me quite a while to learn how to do this and it still does not always do what I think it will.
With OpenGL, you call GLInit(), and forget about it.
OpenGL may not be inherently faster, but in everyday use, the time you save lets you do alot more optimization, so your code will probably be faster.
(not to mention smaller, easier to read, more stable, more portable...)

This topic is closed to new replies.

Advertisement