Should I learn DirectX or OpenGL? (No "never ending" debate intended)

Started by
20 comments, last by jpetrie 16 years, 10 months ago
Hi, I am a fan of open source (my machines runs linux most of the time), so I have a bias to OpenGL+SDL (on gcc) .but at the same time I find that Gaming Market is totally dominated by Windows and and it is biased towards DirectX (VC++ 6.0). Moreover, most of the books that address openGL, do it from a windows context (VC++ 6.0 and etc etc). Please suggest me something. (I have been browsing the internet for a couple of days and am quiet confused about which way to go) Also note that I don't just want to learn it as a hobby, I want to able able to persue a professional career in game development. I hope this thread won't become another never ending debate, since I am quiet aware that both DirectX and OpenGL have pros and cons. it's just that I can't make and decision and stick to it. (I start reading DirectX and think "OpenGL is good" and vice versa) Regards, MI
Advertisement
Yes.
VC++ 6.0 is 9 years old. It is ancient. Further, you can use OpenGL and SDL from Visual Studio just fine (including the modern VS2005 which is vastly preferable to VS6). I've done it myself. What little DirectX "bias" there is that is not just the figments of somebody's imagination is of little consequence -- both OpenGL and DirectX are doing just fine in professional game development.

If you're using Linux most of the time, I'd go for OpenGL. This was the tiebreaker for my own choice between the two graphics APIs. Last I checked, it just wasn't worth the hassle to get DirectX games running under Wine, nevermind trying to develop DirectX games on Linux with Wine.

Regardless of your choice, pick one and stick with it. Really. "Better" is subjective, hard to measure, able to change on a whim, and in the end, completely inconsequential. They're close enough together that the gains of using whichever is "better" are outweighed by the gains of just picking either one and persisting with it. Experience counts more than tool choice here.


MaulingMonkey cues today's ____ versus ____ battle
Hi,

Thanks MualingMonkey, When I say VC++ 6.0, I actually mean Microsoft IDEs (as of there is nothing else left in the world besides MS for GameDev).

About the choice of "better", I totally agree with you...

But how to get over that feeling of "I'm wasting my time with this, DirectX is fast" and "I am wasting my time with this, openGL is standard", :)

I am still at square 1, do I need to toss? ;)

Regards,
MI
Personally I started learning OpenGL. But really it's up to you. If you can't make up your mind I'd go OpenGL. If there is a chance you might want to develop on anything other then Windows I'd go OpenGL. If you specifically want to go highly indepth into gaming as fast as you can I'd go DirectX.

I personally think OpenGL is good place to start. But really either way is fine. But as monkey said, pick one and stick with it.
My personal preference is DX. I prefer DX mainly because they're not afraid to change the API, so when new features appear instead of trying to add them in to what already exists, they redesign so it fits in better. As a result I prefer to use D3D over GL as I find the API more coherrent. Of course a changing API can be very annoying when you have a large codebase using DX, but I don't so it doesn't bother me. GL does have the advantage that when new features come out vendor specific extensions can allow you instant access to them, while in D3D you may need to wait for a new D3D revision.

I do think you should eventually know both APIs, once you've learnt one picking up the other is pretty simple, the concepts are all the same (I personally learnt GL first, I then picked D3D up pretty quickly by simply reading through the docs and writing some code).

If your prefered environment is linux then GL would be the obvious choice, if you do want to use DX you'll probably want to use VC++ as well, you can use DX with other compilers on windows however getting all the includes and libraries working with another compiler may prove tricky, so if you want to avoid VC++ (even if you do want to do your work on Windows) GL may be the better choice.
Personally prefer directX, but my preference has nothing to do with it's ability. I like the feel of it, the way it works, and the way it's structured. The two API's are as close to functionally equal as most would care to measure [minor differences, but generally speaking, anything you can do with one can be done with the other]. Experience with both would be ideal, but for learning purposes, you really should read through each of them a bit, and choose one that you feel comfortable working with. The amount of your code that actually deals with either of these libraries is likely going to be isolated in a rather small sliver of your code anyway, so if you really decide that the other option is better, it's not so bad to convert.

The theory portion of graphics though is API independant, and the skill you pick up in one can be carried over.
While you claim that the gd industry is "biased" towards DirectX and MS specific development tools, it is you who seems biased towards Linux (you said it yourself). I suggest you do some research before making these claims. DirectX doesn't beat OpenGL or vice versa. They are both equal in power and speed and if developing under Linux is your thing, then OpenGL is the probably the best option.

NOTES:
1) OpenGL is _not_ open source, it's an open standard.
2) DirectX and OpenGL are equally fast on the same hardware, period.
3) The game market is what it is, a market. It revolves around money. Developing for Windows and/or the Xbox has its advantages. With DirectX, you kill two birds with one stone, saving valuable time and increasing revenues. The same goes for OpenGL. The Playstation 3 for example, uses a custom version of OpenGL|ES.
4) You can download VS2005 Express for free from the MS site. They're not (that) evil contrary to popular believe. Even the entire MSDN library is free of charge.
5) OpenGL is not unpopular by any means. In fact, most DirectX 10 functionality is already available as an extension set in current OpenGL drivers, without the need for Vista and new architectures/games are on the way (ET:QW).
6) Probably most important: there are tons of tutorials on seting up OpenGL using SDL under Linux/gcc or other combinations of OS and compiler.

EDIT: In short: knowing one API will give you an edge learning the other, but my best bet would be to start with OpenGL. (changed a few points)

Cheers :-)

[Edited by - Todo on June 1, 2007 5:26:26 AM]
Just pick one.

If you're interested in targetting Linux then SDL/OGL is probably a good choice.

- Jason Astle-Adams

For a typical Windows-based beginner, I would suggest starting with DirectX using C#, because of the very nice library-language integration, and the fact that DirectX can be installed very simply on the free Visual Studio 2005.

On the other hand, since you run Linux, then you can probably set up an OGL development environment using your package manager of choice faster than you could migrate to VS2005, so I would say to go for SDL+OpenGL.

Ultimately, if you don't know both DirectX and OpenGL, or if you are not able to learn them in less than a week when required to, you have no business working in professional 3D game development anyway.

This topic is closed to new replies.

Advertisement