Jump to content
  • Advertisement
Sign in to follow this  
kubicon

I want to do 3d programming. What should I learn, Direct3D or OpenGL?

This topic is 5030 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

I was looking at some code for Direct3D and I have to say that this is an ugly API. This lead me to think about using OpenGL instead, but I haven't looked at any code so I don't know if it's any better. I program some GUI before on Linux using QT and on Windows using the Win32 API. From my experience using Microsoft APIs they are no good. They are bulky and give you no help. But the bottom line is: if i have to use it I have to use it.I would be interested to know what you guys use and why do you think it's good. I don't want to start a flamewar here, I just want to know what you personally like about whatever library you use. Since I'm just starting to program 3D, it's best for me to choose what I want to learn now, OpenGL or Direct3D. What do you think are the drawbacks to using your library? I would like to know about some games created using the OpenGL? And, is it true that OpenGL is dying? I appreciate the feedback.

Share this post


Link to post
Share on other sites
Advertisement
There is almost no way to hold an objective debate on which API is "better". Some people like d3d, others like ogl. But since you said you code on Linux then you should probably go with OpenGL.

That said, I like d3d. I like dealling with OO APIs and the D3DX library is packed with usefull features.

Share this post


Link to post
Share on other sites
I know that a debate would get out of control. Because of that, it would suffice if members just mentioned the features they like about their lib, not how they think it's better that the other.

Share this post


Link to post
Share on other sites
If you want to code for linux, and its your personal opinion that MS APIs are "no good" then you should probably look into OpenGL. Perhaps try out both and see which you prefer if you aren't sure, both are excellent APIs. I personally have only used DirectX thus far, but plan to try out OGL soon.

OpenGL is not dying, there have been many discussions of the notion in the past, and generally the idea is considered rather preposterous. As for games using OpenGL, a few that spring to mind (may or may not be right, but I'm fairly sure) include Doom3 and UT2004. Also note that many games provide both a DirectX and an OpenGL renderer. Perhaps you could take a look at some OGL code in the NeHe Tutorials - it probably isn't the best OpenGL code around, but I'm told those are excellent tutorials, and it would give you an idea of how the code looks at the very least.

DirectX is restricted to the Windows platform only (as well as XBox).


In other news, I seem to remember there being a rule against OGLvsDX threads...

Quote:
From the For Beginners Forum FAQ:
8) The infamous "this" vs. "that" threads are considered flame bait. If you’re debating between OpenGL and DirectX or C vs. C++, please try to refrain from creating "which one should I choose" or "which one is better" threads. These threads usually turn into an argument and rarely lead to any kind of conclusion.
The best way to find out if something is right for you, is to try it for yourself or at the very least, spend some time researching the pros and cons.

Share this post


Link to post
Share on other sites
If you want to code for Linux, you have no choice but OpenGL, as DirectX is Windows only.

Share this post


Link to post
Share on other sites
They're using their own libraries (the XBox library uses DirectX if im not wrong). I heard the PlayStation library is similar to the OpenGL library (not including OpenGL 1.2 for PS2)
as you can see, OpenGL isn't for all platforms. you can find out the full platforms list here (DOS is also supported, but on the Mesa project. it is not officially opengl library because its creator hasn't purchased a license from the OpenGL ARB.
I think Mesa3D support more platforms that the official OpenGL doesn't, list can be found here).
P.S. You can use OpenGL for PlatStation 2, Amiga, Risc OS, Mobiles, etc.
So i guess opengl is for consoles too, but i dont think the consoles uses only OpenGL and not their own API.


By the way, OpenGL isn't dying. in the "OpenGL 1.2 for PS2" link i posted you can find a pdf page where there is a list of good products that uses OpenGL, including Quake, Half Life, Hexen 2, Descent 3, Diablo 2, One Must Fall 2, Unreal and Duke Nukem Forever.
I'm sure that there are people who say that OpenGL is dying because there are a lot products that aren't uses OpenGL. The reason is simple:
It can be that the company doesn't have enough time to program for both OpenGL and Direct3D, and most gamers uses Windows or Linux with Wine so they doesn't have to care (I don't really know if Wine can run DirectX programs).
But did you know? Direct3D can be faster than OpenGL, and vice versa. its up to the graphics card, so an engine that support both OpenGL and Direct3D is a good, even if it is for Windows only. (My opinion! but its true that its up to the gfx card)

pex.

[Edited by - pex22 on January 5, 2005 10:30:23 AM]

Share this post


Link to post
Share on other sites
Quote:

does playstation/game cube/whatever uses openGL or do they have their own libs?


Forgive me if I'm wrong, but it sounds a little like you're planning ahead for console programming.

IMO, this is missing the point entirely. Both API's are based on a set of mathematical (and hardware) principles. The key step is understanding those principles. Once you understand what the API's are doing in the background, then it won't matter whether you use OGL, DirectX, or anything else for that matter. The only difference is in the syntax.

And, from what I've read, the simple fact is that at some point you'll need to understand the principles - because you may end up on a platform that has no API support, or you'll want to do something outside the bounds of the API. At that point, you'd better understand what's going on under the hood or you're stuffed.

So - try both out (and that means give them a little time, not just a glance over and a rotating triangle). Pick the one that appeals. But understand why it's doing what it's doing.

Jim.

Share this post


Link to post
Share on other sites
If you're coding oin Linux then there won't even be a choice. You just have to go with OpenGL.. Personally I prefer OpenGL. The cross-platform feature is very appealing, unlike its counterpart D3D.

Share this post


Link to post
Share on other sites
I found OpenGL a lot easier to set up and get an example running than DirectX, so I think you should start with OpenGL so you dont get frustrated early on.

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!