Jump to content
  • Advertisement
Sign in to follow this  
TheCompBoy

DirectX vs OpenGL ?

This topic is 2519 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!
I read about DirectX and OpenGL and which one is the best to use for what and which one is bad at what..

All i found was that OpenGL is cross-platform and its easier to code with it.. But is this realy true or can some one please provide me with a better website where i can read about it ? Or something,

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Previous threads here

GL works on Linux/Mac/Windows
GLES works on mobile devices and browsers
DX9 works on Windows XP/Vista/7
DX11 works on Windows Vista/7

GL has 4 main versions --
* GL1 is the basic stuff that the majority of tutorials will cover. This is old and deprecated, but can still be used as an introduction to graphics programming.
* GL2 is the equivalent to DX9. It adds shaders and other 'modern' features.
* GL3/GL4 are the modern versions, equivalent to DX10/11.

GLES has 2 main versions -- one for older mobiles, and one for newer mobiles with more modern features.

D3D has 3 main versions at the moment --
* DX9 is only used if you need to support Windows XP.
* DX10 has been superseded by DX11, and isn't required any more.
* DX11 is the current gold standard for graphics APIs, but only works on Vista/Win7.

Share this post


Link to post
Share on other sites
OpenGL is a cross-platform graphics API. It only does graphics. It is easier to initialize than DirectX, but I don't think it's significantly easier or more difficult to use. I haven't looked at it in a while, so I'm not the guy to give you many specifics. Also, you'll need other libraries if you want sound or game-controller support.

DirectX is Windows-only, and has APIs for sound and input as well as graphics. It's a bit more complicated to set up, but not severely so. If you're targeting WinXP then you're limited to DirectX 9; if you're not targeting XP then look at DirectX 11. DirectX 9 still has a fixed-function pipeline, which makes it easier to get into than DirectX 11's shader-only model, but so much has changed between the two versions that learning DX 9 has limited benefits if you're more forward-looking.

Share this post


Link to post
Share on other sites
just pick whichever one your more comfitible with.
from what ive read and checked out, there is no "real" difference between the two, other OpenGL does not care weather your running XP/Vista/Win7 it wont cut you off from features if your card supports it.

Share this post


Link to post
Share on other sites
Choosing between DirectX or OpenGL is largely pragmatic. "Knowing" how to use a given API is purely semantics so don't get bogged down with "is x better than y", especially at this stage.

Share this post


Link to post
Share on other sites
I (subjective opinion!) would definitively say yes, OpenGL is easier and better to read than DirectX.

Take a look at a DirectX "Hello World" and OpenGL "Hello World". You will be able to read the OpenGL-code at once, but with DirectX you will first think of "wth? What's LPWSTR? pd3dDevice? SRV? Why aren't there any self-documenting names?". (at least that's what I thought of my first DirectX tutorial)

And it's getting even worse if you what to find a very uncommon functionality in the msdn documentation AND understand it. - good luck!
Well, OpenGL hasn't a super-good documentation either, but most function-names (I had to use) are self-explaining.

If you want to use DirectX, Program on Windows or if you like Visual Studio then ok. If you don't care I would use OpenGL.
But take a look at a Hello World Example of both before you make a decision! ;)

Share this post


Link to post
Share on other sites

I (subjective opinion!) would definitively say yes, OpenGL is easier and better to read than DirectX.

Take a look at a DirectX "Hello World" and OpenGL "Hello World". You will be able to read the OpenGL-code at once, but with DirectX you will first think of "wth? What's LPWSTR? pd3dDevice? SRV? Why aren't there any self-documenting names?". (at least that's what I thought of my first DirectX tutorial)

And it's getting even worse if you what to find a very uncommon functionality in the msdn documentation AND understand it. - good luck!
Well, OpenGL hasn't a super-good documentation either, but most function-names (I had to use) are self-explaining.

If you want to use DirectX, Program on Windows or if you like Visual Studio then ok. If you don't care I would use OpenGL.
But take a look at a Hello World Example of both before you make a decision! ;)


While you are thinking about that, keep in mind that DirectX is built using "simple" COM. Whether you believe that is a good thing or not, a capable Windows programmer should have a good understanding of the naming conventions found within the API.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!