Should I Use OpenGL Or DirectX?

Pages: 12
Greetings,

After much research, I still haven't picked my choice in the treacherous question "Should I use OpenGL or DirectX?". My two friends and I are making a game, and I'm the programmer. We are making the game for fun, and likely not selling it. However, I'm looking at becoming a game programmer when I'm older, so that's a factor. Here's what I'm looking for.

- Which one do you think easier to learn and use?

- Which one do you think works better?

- Which one do you think has less problems?

- Which one do you think has a better chance of getting a job?


So what do you think? Although I don't care who answers, I'm mainly looking for people who have used one or both.

Thank you,

Gollum and the Evil One
OpenGL -
Pros:
- Crossplatform

Cons:
- Only rendering API
- Worse Drivers than DirectX (This is slowly changing however.)

DirectX -
Pros:
- Great driver support
- Can handle graphics, audio, input, and sound

Cons:
- Proprietary
- Windows/Xbox only
- Other audio, input, and sound libs are favored over DirectX's (Basically I mean they're bad.)

------------------
So really it's a matter of which people you'd like to target. I'd say go for both, it can't hurt.

Starting out I'd say use OpenGL.
Last edited on
Just adding to that:
If you are learning OpenGL, make sure to learn 'modern' OpenGL (i.e. > 3.0). One good site for that is the arcsynthesis tutorial: http://www.arcsynthesis.org/gltut/
I'm starting to learn OpenGL mainly because it is cross platform. I get the feeling that OpenGL is going to start gaining more ground in games because it is cross platform, while Microsoft and DX are going to be stuck on windows/xbox while the rest of the world carries on.
(Edit: but obviously it wont take over, it's just a feature that DX lacks and gives a reason to learn OpenGL).

Valve are backing up OpenGL which is bringing more driver support to Linux.
Last edited on
OpenGL may be gaining more ground, but I'm 99.9% sure it will never replace DirectX.
Neither one will ever "replace" the other.
Windows/Xbox only

Oh no...


Both of my friends use Mac. Although they both have Bootcamp and their dad has a Windows, I know they would much rather play it on Mac's operating system. Also, one of our friends who wants to test our game has two computers, both of which are Macs.

And DirectX is proprietary? I want us to own all the rights to our game. So if Directx is proprietary, that really messes things up.

So I think we will use OpenGL. However, I'd still like to hear other's thoughts.


~Gollum and the Evil One
If you make something with DirectX, it is your's and you can do whatever you wish with it.
^Yea pretty much

----------------

OpenGL is pretty much your only option in that case. Use a cross-platform lib for windowing like SFML 2.1 or SDL 2.0.
Sorry, I didn't mean it would replace DX I just meant it is worth learning it because it's gaining popularity.
But I see that it could be taken that way, I just meant that it being cross-platform would leave DX behind in that particular area because DX is so predominant on windows.
Last edited on

If you make something with DirectX, it is your's and you can do whatever you wish with it.

What???

What does Avilius mean by proprietary then?


~Gollum and the Evil One
Last edited on
I mean that other companies can't add onto it like the can with OGL.
I mean that other companies can't add onto it like the can with OGL.


Waaaaat?
Like extensions. I never here about dx extensions, but always OGL.
I mean that other companies can't add onto it like the can with OGL

Oh good. I don't think I'd want to do that anyways.


Anyways, I got two more questions. First, which do you think has a better chance of landing a job, and second, which library does Skyrim use? I'm asking because for consoles, Skyrim works on Xbox 360 and PS3 (which seems like OpenGL), but computer-wise, it only works on Windows (which seems like DirectX).
Last edited on
Avilius wrote:
Like extensions. I never here about dx extensions, but always OGL.


Okay.

It sounded to me like you were saying if he made his game to use OpenGL, then other people could add on to/change his game.

But you were actually saying that people can add on to OpenGL itself.


Gollum wrote:
First, which do you think has a better chance of landing a job


From what I've seen (which isn't very much)... jobs in the gaming industry typically use existing engines, rather than rewriting engines from scratch for every new game. So experience with OpenGL or DirectX, while definitely a plus, is probably not at the top of what they're looking for. Experience with their engine would be the biggest seller.

But really... the only way to get a real answer to this question is to look at job postings and see which ones are looking for DX experience... and look at which ones are looking for OGL experience.


If you're really that concerned about building a portfolio... one thing you could do is:

1) Get [reasonably] familiar with both OGL and DX
2) Write an abstraction layer so your game can use either one.
3) Make it so the user can select which one they want to use.



which library does Skyrim use?


I'm 99% certain Skyrim (and pretty much any other AAA title) is going to use an abstraction layer and isn't going to touch the graphic API directly.

Specifically... PS3 has its own proprietary graphic API (not DX nor OGL).


Though underneath all the abstraction, I'm pretty sure Skyrim uses DirectX on Windows.
Last edited on
What's an abstraction layer?
Last edited on
It's basically an extra layer of code that separates 2 existing layers.

For example... you have 2 layers here:

- Your program
- DirectX


An abstraction layer would sit between them:

- Your program
- Abstraction Layer
- DirectX

The idea is... all the graphic code your game does will be in the abstraction layer. You will never touch anything in the DirectX layer directly.

For example... you could write a function "DrawPolygon" that draws a single polygon to the screen. This function would then contain all the DirectX code necessary to accomplish that.


The benefit to this is that your program is now completely removed from the graphics API. And you can easily swap in/out other graphic APIs (like PS3, OGL, or even a Phone's API) by plugging in different implementations for the abstraction layer.
First, which do you think has a better chance of landing a job
Do you want to do game programming or game engine programming? If you want to do game programming, like Disch said, you most likely won't have to touch either API. If you want to do engine programming, it'll most likely require both.
Using Linux, i'd say OpenGL. But really you will probably end up using something like OGRE and use both.
Pages: 12