OpenGl or DirectX?

Started by
27 comments, last by NegativeGeForce 18 years, 1 month ago
DirectX/Direct3D (and Microsoft in general) really have their act together, in that MS Visual Studio, the DirectX SDK, Samples, FX, etc, are all coupled together very nicely.

That being said, OpenGL is much easier to use, as has been said. But, now learning Direct3D myself, I'm seeing how to make my applications much faster. (I didn't even know about vertex buffers before starting with Direct3D!)

So, I'd suggest (in chronological order):

1) Learn OpenGL fairly well, do some projects with it
2) Dive into Direct3D, try doing some comparable projects, or even porting the same ones to Direct3D to see the differences/analogous functions
3) Take a step back and compare yourself
--== discman1028 ==--
Advertisement
Just to let you know, you don't have to learn OGL first; I jumped right into Direct3D with no prior experience on any other API, and I was able to pick it up fine. Just make sure you get a book on either API you want to learn, they're both too complex to be learned from an online tutorial (though I hear NeHe is pretty good for OpenGL).
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
OpenGL all the ways!

OpenGL = you can use it with C or C++, cross platform, very good documented, lots of examples on net. Peoples say OpenGL have problems with extensions. This is not true. Is very easy to deal with them, and that makes it powerfull.

DirectX = another MS modification to real world. At every new version, something is added and something is removed!!! Good luck with COM interfaces and MS styles. You will fing the limitations later.

p.s. I was coding for D3D last 3 years, switched everything to OpenGL, and i got better results, overall, after i love OpenGL now. And i use it with C++ all the time.
The both have advantages and disadvantages. There is a lot of rumors about DirectX being harder than OpenGL, in my opinion that is not correct. If people themselves try it and conclude that OpenGL is the easiest I have no problem with it, but many just say OpenGL is easier because they heard someone more experienced say it (maybe many years ago). I found it much easier to understand DirectX because you needed to understand it. When I learned OpenGL I felt like I was just using other code. glIdentity is just something to put between drawings, glRotate[f/d] rotates the next object. But when suddenly the objects rotated around 0,0,0 instead of itself I had no idea what was wrong (I blamed my driver[grin]). Which is easier is pure personal opinion.

Quote:From an article comparing D3D and OGL (2002)
Many OpenGL advocates point to something Carmack wrote several years ago, trashing Direct3D. Only, that was during the days Direct3D 5. In a much more recent post on www.slashdot.org, Carmack said that with the new advances in D3D, it could no longer be ignored. Direct3D has to be used by programmers along with OpenGL.


We have now used DirectX 9 for a long time and DirectX 10 will soon be out. Please if anyone says Carmack is smart and he doesn't like DirectX then ask them for a source, less than one year old (which is a lot in the graphics industry). Carmack actually said he liked the tools on the XBox360 (one of those "tools" is D3D, the DX version is called DirectX 9L if I remember correcly) better than the ones on the PlayStation 3 (here one of the tools is OpenGL, well a version of it). Please remember this doesn't mean that he favors DirectX either, it was the tools on XBox360 and PlayStation 3 he commented on not DirectX and OpenGL.

One thing which you want to take into consideration is that there could come some problems with OpenGL on Vista, noone can really answer how bad it will be, but more understanding is that OpenGL will be locked at some version and when using that version in windowed mode you will either have to switch to another skin or let the calls be translated to D3D calls. I haven't read a lot about this and some people here knows a lot more about the situation (but it appears that some people have signed a NDA). I wouldn't worry too much about this until Vista have been released. I think this is mentioned in the FAQ for the OpenGL forum.

I think it would help you the most to choose one, stick to it until you can create a very simple pixel/vertex shaded world (shaders will be very important in the near future, most games already use them). Then learn the other graphics API.

[Edited by - CTar on March 14, 2006 8:57:12 AM]
Quote:Original post by clouds
OpenGL all the ways!

For an XBox or XBox360 game? Of course, we just have to ship some modified, most likely illegal, hardware with the game.

Quote:Original post by clouds
OpenGL = you can use it with C or C++, cross platform

I believe you can also use DirectX with C and C++, and a lot of other languages. Cross platform, yes this is true, but if you plan to code for the XBoxes then you will still have to use DirectX.

Quote:Original post by clouds
very good documented, lots of examples on net. Peoples say OpenGL have problems with extensions. This is not true. Is very easy to deal with them, and that makes it powerfull.

You say OpenGL is very good documented? It might be, but do you mean that DirectX is worse documented? From what I have seen the DirectX documentation seems MUCH better, but there is a little more books on OpenGL. I can't comment on the extension issue since I haven't used it, but I can imagine it is a hell to keep organized.

Quote:Original post by clouds
DirectX = another MS modification to real world.

Ehh, I don't even think I have to comment on that. According to "who's online" then you are online... Using Windows XP, one of Microsoft's "modifications". Please don't turn this into a thread about how evil MS is.

Quote:Original post by clouds
At every new version, something is added and something is removed!!! Good luck with COM interfaces and MS styles. You will fing the limitations later.

The graphic industry is evolving very quickly, graphic APIs need a way to support new features. OpenGL have chosen to add something called extensions which most people find ugly and a big problem in their applications. Microsoft have instead chosen to make, what they feel is, a cleaner interface, but let the developers need to update some of their code around once a year if they want to update to the next DirectX version. In OpenGL you'll have to add code to support new extensions. In both APIs you can ignore the changes (just don't update version in DirectX) or you can try to use the newest features. To use these new features you will have to do some updating of your code. Have you ever read the "What's new" list in DirectX? It is often short and in most changes it is some parameters changed or something added to the API.

Quote:Original post by clouds
p.s. I was coding for D3D last 3 years, switched everything to OpenGL, and i got better results, overall, after i love OpenGL now. And i use it with C++ all the time.


You might be a better code with OpenGL, it might have something to do with using OpenGL on newer hardware (you used it after DirectX). In most professional applications I get better performance with Direct3D (newest GeForce driver, GeForce 6600GT), but that could be for a million of reasons, like a poor driver, better DirectX programmers, most focus on DirectX etc. But I can't give a reason since I don't know how these things works, just like in your code.

EDIT: In this post I defended DirectX (well actually Direct3D), but really I think they both have their place and on Linux, the play stations and the XBoxes there are no real choice you just have to learn what you can use on those platforms.
Quote:Original post by CTar
The both have advantages and disadvantages. There is a lot of rumors about DirectX being harder than OpenGL, in my opinion that is not correct. If people themselves try it and conclude that OpenGL I have no problem with it, but many just say OpenGL is easier because they heard someone more experienced say it (maybe many years ago).


For me, DirectX was more difficult to understand because I was struggling with Object-Oriented programming. Now that I've gotten loads better, picking up some docs on DirectX and going through them is very simple. Granted, DirectX does take a bit more code to set up than OpenGL; but, it does give you a better understanding, and (from my point of view) more control.

To Boder, all I can really say on choices, if you prefer doing things the OOP way, then take a gander at DirectX. If you're still struggling with OOP concepts, maybe you'll want to start with OpenGL. Nowadays, either one is sufficient as a starting point, and there's loads of information out on the net for both APIs.
Quote:Original post by Lazy Foo
Start out with OpenGL (it's easier to get off the ground), but you should eventually learn both.
Some would argue the other way around. DirectX is extremely object oriented (you're dealing with matrix objects) and object orientation is more natural to beginner programmers. OpenGL is extremely procedural (you're dealing with the matrix stack) which requires some background programming knowledge like the stack system, etc.

My advice would be to try both and see which one you like most and then focus on that. Once you get good with one, it's easy to go back and forth as the 3D concepts introduced in both APIs are generally the same [wink].
Rob Loach [Website] [Projects] [Contact]
Quote:Original post by CTar
One thing which you want to take into consideration is that there could come some problems with OpenGL on Vista, noone can really answer how bad it will be, but more understanding is that OpenGL will be locked at some version and when using that version in windowed mode you will either have to switch to another skin or let the calls be translated to D3D calls.
Actually we can say how bad it will be, because the rumors were debunked a while ago. There will be no problems with OpenGL on Vista.
Quote:OpenGL all the ways!

OpenGL = you can use it with C or C++, cross platform, very good documented, lots of examples on net. Peoples say OpenGL have problems with extensions. This is not true. Is very easy to deal with them, and that makes it powerfull.

DirectX = another MS modification to real world. At every new version, something is added and something is removed!!! Good luck with COM interfaces and MS styles. You will fing the limitations later.

p.s. I was coding for D3D last 3 years, switched everything to OpenGL, and i got better results, overall, after i love OpenGL now. And i use it with C++ all the time.
I suppose it's quite unfortunate, then, that the vast majority of the game industry does not agree with you. Except for games based on id tech, and games running on other OSes, very few use OpenGL. In fact, I can't think of any non-D3 based games that are using OpenGL. Even Unreal, Warcraft 3, and the handful of other portable titles will use Direct3D on Windows.

My final word on the matter is this. Load a textured mesh in OpenGL. Load a textured mesh in Direct3D. QED. (For you clever ones who are familiar with the 3rd party OpenGL libraries, now fix bowties and other inconsistencies in your mesh, optimize it for optimal vertex cache usage, and compute normals and tangents. We're up to maybe 10 lines of D3DX code here.)
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Learn D3D10!
Allegro!

p.s. I'm kidding.

This topic is closed to new replies.

Advertisement