Link to home
Start Free TrialLog in
Avatar of MrSotomonte
MrSotomonte

asked on

Why to choose DirectX or OpenGL?

Hello

I'm just starting to learn some programming languages; I've started with C and actually I'm in C++, and I'm planning to move on a graphics language, such as DirectX or OpenGL. But I don't know their differences, don't know why to choose one or another.

Thanks in advance, I'll be waiting for your replies
Avatar of joachimc
joachimc

Their similarities are bigger than their differences. DX has a strong support from MS and openGL from the open source community.

If you only program for windows I would probably choose DX. Otherwise openGL is the obvious choice.

There is not a real answer to this question so I am not expecting 80 points for this one :)
ASKER CERTIFIED SOLUTION
Avatar of errorx666
errorx666

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Basically DirectX is more windows dependant, but offers more features as far as sound and graphics.  If you plan on doing anything strictly windows go with this.

For everything else, there's OpenGL, it's open source as the other guys said, so it offers more flexability at the expense of a few bells and whistles.
Avatar of MrSotomonte

ASKER

Well, thanks for your replies, I've found them all useful.

I think I've posted this on the wrong section and I've spend too much points on this ambiguous question as I'm new on the community, but from now on I'll try to do it OK.

I'll be posting more questions soon as I get more points :)

Thanks again
I think that the main issues have been asked. I can only add a few considerations. I don't think there is a 'wrong' choice.
Differences
Speed
-Some cards will run games at very different speeds depending on the choice of OpenGL or DirectX.
EG On a Voodoo2 state changes were very cheap in OpenGl, but very expensive in DirectX.
The way that you use each will affect the speed and you won't be able to just 'replace function names' and use your old engine to change from one to the other.
Coding style
-I have heard that OpenGL is 'more elegant' than DirectX, and from my experience DirectX is a little bit of a mess, however once you have worked out your basic setup you will forget most of that pain.
-Future of your program.
Do you want to port your code to a non-MS OS (choose openGL) or maybe the Xbox (DirectX)?

Frmm my knowledge of DirectX (some programming) and OpenGL (theorectical, read a few books) you wouldn't be wrong choosing either. The theory is practically the same and if I were looking for a good DirectX coder I think I'd be better off getting someone with good OpenGl experience and helping them rather than getting an inexperienced DirectX coder, if you see what I mean.