Jump to content
  • Advertisement
Sign in to follow this  
Phillipe

OpenGL DirectX versus OpenGL - A very newbie question...

This topic is 4907 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 there. I was wondering, is the only difference between the DirectX API and the OpenGL API is that the OpenGL API is being supported by more OSs and game stations than the DirectX API does (while DirectX runs only under the Windows OS and maybe on some game stations, I'm not totally sure - OpenGL runs under the Linux, Mac OS X and Windows OSs AND under the Game-cube, X-box and Playstation game stations)? As far as my understanding goes, they both capable of the same abilities (that is, performance wise and functionality wise). So, is the aforementioned correct? The only difference between the two APIs is that the OpenGL API is being supported by more OSs and game stations than the DirectX API does? IMO there must be another difference, because an API that is being supported by more OSs and game stations than another API AND that has the same abilities as the other API would have been used by every programmer (more OSs and game stations that support the API you are using = more copies of your software being sold). Am I correct? I'm asking this because I've just finished my C++ course and I'm ready to start and learn some API, I just don't know which one to choose (well, it must be one of the two mentioned above - DirectX\OpenGL. SDL and such are not "sophisticated" enough for a decent programmer such as I [wink]). I got all the foundations needed (that is, math, physics, high-level programming language, etcetera...), all I need to know is the differences between the two (advantages\disadvantages). Thanks a lot in advance, Arie. P.S. - I'm sorry if this question has been asked before (and I'm sure it has [rolleyes]), I just couldn't seem to find the answers I'm looking for anywhere. Thanks a lot again. [smile]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Almost same, learn both.

Share this post


Link to post
Share on other sites
While OpenGL is an API for rendering graphics, DirectX is an API for graphics, sound, video, input and networking. There are still other APIs like OpenAL.

Anyways, if you create a game engine, provide enough abstraction to let the user select between OpenGL and DirectX. Sometimes the graphics drivers for one of them are better than for the other. I think it will also lead to a better design of your engine.

Share this post


Link to post
Share on other sites
AP: I know they are, as you said, "almost the same". My question is how they differ from one another? does one give you more control? more efficiency? what ARE the differences between them?
Thanks a lot [smile].

Share this post


Link to post
Share on other sites
I believe we have a fairly fresh topic about this, here. Perhaps you can find some information there. Actually, there is an article about it, too, right here.

To answer your question specifically, yes, OpenGL supports multiple platforms. However, in my experience, I've found that not many gamers play on those other platforms, anyways. Most stay with Windows.

However, the exception to this is with the Sony line on consoles. The PS2 uses OpenGL for rendering (IIRC), and with the advent of OpenGL-ES, only more are going to use it. On the other hand, Direct3D is also used on both the XBOX and the XBOX2 (aka Xenon).

If you spend the time to learn the fundamentals of graphics programming, then learning both really isn't that hard at all. However, it's important that you understand the concepts behind them, first.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Phillipe
My question is how they differ from one another? does one give you more control?

No/

Quote:
Original post by Phillipe
more efficiency?

No.

Quote:
Original post by Phillipe
what ARE the differences between them?


Besides that DX provides input, sound, network and only runs on Windows and XBox, both are the same. That includes control and efficiency.

It is good to know both.

Share this post


Link to post
Share on other sites
So I see... Well - learning both and letting the user choose which API would he like to run the software under seems like the ultimate answer for all my questions.
But yet, as said above (or somewhere else I jsut can't seem to recall where), OpenGL is a Graphic API (that is, it is only taking care of the aspect of displaying objects on the screen) while DirectX is a Multimedia API (that is, it is taking care of the same thing that the OpenGL API does plus it is talking care of the networking, sound, etcetera...).
So, assuming I only know OpenGL, how am I supposed to control the sound and networking, for example?
Thanks a lot in advance [smile].

Share this post


Link to post
Share on other sites
Direct3D is more frequently and, IMO, coherently updated, but new functionality provided by certain hardware can not be used until officially "rolled in." OpenGL API updates are less frequent, but new functionality can be accessed through vendor extensions, which eventually migrate into ARB extensions.

Quote:
Original post by Phillipe
So, assuming I only know OpenGL, how am I supposed to control the sound and networking, for example?
There are multiplatform abstraction libraries for many of these aspects, such as OpenAL or FMOD for sound and HawkNL for networking. We have an Alternative Game Libraries forum dedicated to these various libraries, for instance.

Share this post


Link to post
Share on other sites
It's important to understand that you CAN use the individual components of DirectX separately. For instance you CAN use DirectSound with OpenGL. Or Direct3D with some other networking library, etc... So for Microsoft-based platforms, you might as well just use DirectX for the non-graphics components until something better pops up. If you design your software carefully, it should, theoretically, be very easy to replace any platform specific APIs.

For other platforms, I really can't say since I don't have experience with any. I'm sure their are several, free, libraries out their. FMOD for sound has come up plenty of times. It's supposed to be platform independent and free.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Oluseyi
Direct3D is more frequently and, IMO, coherently updated, but new functionality provided by certain hardware can not be used until officially "rolled in." OpenGL API updates are less frequent, but new functionality can be accessed through vendor extensions, which eventually migrate into ARB extensions.


Oluseyi, sorry for this stupid question, but how exactly does OpenGL get updated? DirectX has the dowloadable SDK from Microsoft but for the life of me I cannot find downloadable OpenGL libs. I know that there are OpenGL libs implemented by Microsoft and packaged in VC++ but how do you get to update that?

Thanks.

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!