Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesGame Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
« Previous Thread | Next Thread » Featured Thread Featured Thread  
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 27th, 2007, 06:03 AM
ryon420's Avatar
ryon420 ryon420 is offline
No more bull****
Click here for more information. Click here for more information
 
Join Date: Jun 2006
Location: Was lost, then found, now lost again.
Posts: 2,990 ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)ryon420 User rank is General (90000 - 100000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 5 Months 2 Weeks 4 Days 13 h 31 m 52 sec
Reputation Power: 925
Send a message via MSN to ryon420 Send a message via Google Talk to ryon420
Direct3d vs OpenGL?

Hey everyone,

I am planning on making a 3d game soon. But I would like to know which is better to use. OpenGL is used for most games, but d3d seems cool too. Anyone know which is better?

BTW, I am going to be using this with C++.
__________________

Warning, the post above may contain extreme sarcasm, crude language, and code that may confuse amateurs and professionals.


Helpful stuff: Google your question first | Read the rules | How to ask a question | Read the [PHP] manual, it is good for you
Proud supporter of: Philosophorum - "where even the trolls are smart" | Chikyu Hakken - digging for trolls
"Any excuse will serve a tyrant." -- Aesop


Reply With Quote
  #2  
Old February 27th, 2007, 09:50 AM
Oler1s Oler1s is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2006
Posts: 1,540 Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 23 h 57 m 15 sec
Reputation Power: 471
"OpenGL is used for most games, but d3d seems cool too. Anyone know which is better?"

Neither. The question has been asked over and over and over in internet forums for a long while, and despite the endless discussion, no answer emerges. It's better to look at the facts and make a decision for yourself.

Portability: DirectX is definitely Windows only. So for linux graphics, you must use OpenGL. Of course, a majority of apps and commercial games are made for Windows, so DirectX is incredibly popular.

Packaging: OpenGL is graphics only. It does not come as part of a bigger system. Do you want sound? Networking? User input? You'll need to find other libraries to work with. Or frameworks or layers like SDL to work through. Direct3D on the other hand is part of DirectX. Once you want sound and all the other stuff that commonly comes with games, it's quite nice to just move over to a sibling library.

Initial learning curve: I feel OpenGL has an edge over Direct3D for this. That's because DirectX involves COM. It's not a real pain if you're a competent C++ programmer, and if you have worked with COM before, the environment should be quite familiar. But the point is, initially OpenGL can feel a whole lot easier to start with.

In the end, it makes no difference. Countless commercial games have been written to use OpenGL and the same for DirectX. Direct3D and OpenGL can accomplish the same things. Any game engine, framework, or something along those lines either supports both libraries or has a clone for the other one. Point is, pick one and stick with it.
Comments on this post
niczak agrees!
__________________
C/C++: Books, C FAQ, C++ FAQ, C/C++ Reference.
Python: Website, Beautiful Soup.

Reply With Quote
  #3  
Old March 2nd, 2007, 10:36 AM
niczak's Avatar
niczak niczak is offline
PHP Poster
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Location: Nevada
Posts: 237 niczak User rank is Sergeant (500 - 2000 Reputation Level)niczak User rank is Sergeant (500 - 2000 Reputation Level)niczak User rank is Sergeant (500 - 2000 Reputation Level)niczak User rank is Sergeant (500 - 2000 Reputation Level)niczak User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 17 h 34 m 33 sec
Reputation Power: 8
Send a message via Google Talk to niczak
Oler1s: Great post. I agree very strongly that its important to pick one and stick with it. In making your selection it is very important to consider which platform(s) you are wanting to develop for, like Oler1s said D3D limits you to one platform, where OpenGL works on Windows, Linux and Mac 10.x platforms.

To be completely honest I haven't worked with either one, however my colleagues that have all agree that OGL provides better documentation, better access to help and a more intuitive development environment.

In short, if you are strictly developing for windows and you have familiarity w/ COM && || Microsoft DirectX API's in general then I would go the D3D route, if there is any chance at all that you are looking to port this to another platform in the future than I would save yourself some headache and use OpenGL from the get-go.

-Nick

Reply With Quote
  #4  
Old March 8th, 2007, 11:44 AM
Relinquished Relinquished is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 37 Relinquished Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 5 h 12 m 2 sec
Reputation Power: 0
DirectX is purely Windows, so if your making a game only for windows, its good

If you don't mind, I suppose its down to personal taste.

Sorry if I've been a bit vague in this post, but I've had absolutely no experience in openGL and only a little in DirectX. Well I am only 15!

Reply With Quote
  #5  
Old March 9th, 2007, 03:01 AM
dynamicVoidMain dynamicVoidMain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 110 dynamicVoidMain User rank is Corporal (100 - 500 Reputation Level)dynamicVoidMain User rank is Corporal (100 - 500 Reputation Level)dynamicVoidMain User rank is Corporal (100 - 500 Reputation Level)dynamicVoidMain User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 17 h 53 m 9 sec
Reputation Power: 5
Up to you, I'm planning on learning Directx but I'll definitely get around to learning openGL too, you can never know too many API's

Anyone who says one is better than the other is just fibbing to him/herself, the only real distinct clear advantage opengl has over directx is portability, thats about it, if you are developing for windows choose the one you want to get into more for whatever reason (which is why i recommend directx, easier for newbies thanks to microsoft )

Last edited by dynamicVoidMain : March 9th, 2007 at 03:07 AM.

Reply With Quote
  #6  
Old March 11th, 2007, 11:53 AM
jorgejones jorgejones is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 134 jorgejones Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 4 h 58 m 35 sec
Reputation Power: 0
Actually... nowadays OGL support is better than D3d for the lower-end GPUs. And the plus of having multi-platform support, should give you a good idea of where to aim at.

Thing is... D3D might become cross-platform this year or the next one. But as I said, on lower-ends you wont have good support for this (and by support I also mean performance).

Reply With Quote
  #7  
Old March 25th, 2007, 06:51 PM
imsangha imsangha is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Location: Concord, California
Posts: 20 imsangha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 34 m 22 sec
Reputation Power: 0
Send a message via MSN to imsangha
I have a quick question. How is OpenGL pronounced?

Reply With Quote
  #8  
Old March 26th, 2007, 02:00 AM
Viper_SB's Avatar
Viper_SB Viper_SB is offline
Psycho Canadian
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jan 2001
Location: Canada
Posts: 4,788 Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 4 Weeks 19 h 51 m 40 sec
Reputation Power: 437
hmm not sure I always say "open" "G" "L"
__________________
Miscellaneous Software
Viper_SB
Developershed E-Support


Anyone else play chess?
Challenge me

Reply With Quote
  #9  
Old July 24th, 2007, 06:04 PM
maddog39 maddog39 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Location: Pennsylvania, US
Posts: 7 maddog39 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 5 m 16 sec
Reputation Power: 0
Send a message via MSN to maddog39
Errr.... Okay. I dont think alot of people here have a clue about what they are talking about. The statement about OpenGL being used for more games is utterly wrong. Most games, very unfortunately, are written using DirectX... why do you think the Mac and Linux platforms have so much trouble with gaming. Its quite obvious if you ask me, because all (most) of the games use microshafts proprietary crap. Which lets them lock you into their platform.

Now, ignoring for a minute, the whole separate problem of portability. Direct3D and OpenGL are sort of similar, but I have found that by far, Direct3D seems to be much harder to understand to less advanced users although it does also particularly have a lot of helper functions that do some extra work for you. Where as in OpenGL you may not have those. But I find that in most cases OpenGL makes for much cleaner much more understandable code and is much simpler to understand for "beginner" users.

Reply With Quote
  #10  
Old July 24th, 2007, 06:24 PM
Oler1s Oler1s is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2006
Posts: 1,540 Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 23 h 57 m 15 sec
Reputation Power: 471
Quote:
I dont think alot of people here have a clue about what they are talking about. The statement about OpenGL being used for more games is utterly wrong.
Can you point this statement out?

Quote:
why do you think the Mac and Linux platforms have so much trouble with gaming.
Well, this is a really a chicken and egg problem, isn’t it? It’s not just DirectX that’s problematic. It’s the fact that non-trivial programs require OS specific code. To that end, you either write your program in an API with a cross platform layer that has OS specific implementations, or one that is directly OS specific itself.

Quote:
Its quite obvious if you ask me, because all (most) of the games use microshafts proprietary crap. Which lets them lock you into their platform.
Unfortunate yes. But you realize, games require budgets, and companies want a return on those budgets. Preferably a big and profitable one. Just don’t be so quick to criticize lock in.

It’s important that beginners understand the philosophies of the APIs. OpenGL presents a C-ish API. It works as a state machine. You make a number of calls to this machine to achieve what you want. It’s easy for beginners because the beginning logic is obvious. Everything is laid out sequentially. In addition, OpenGL takes care of some low level issues for you, that Dx doesn’t.

DirectX involves COM. The API takes on an OO approach, or at least how COM does it. This makes it difficult initially for beginners, unless you happen to understand COM. If you don’t know how to think in an OO manner, and don’t understand how COM approaches it, it’s very difficult initially. Couple that with the additional resource management that DirectX expects of you, and you can see why initially OpenGL seems easier than DirectX.

So clearly, in the end, it won’t matter. You’ll get over the beginner learning curve, which leaves you with two APIs that are just as powerful as one another.

Reply With Quote
  #11  
Old July 24th, 2007, 06:55 PM
maddog39 maddog39 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Location: Pennsylvania, US
Posts: 7 maddog39 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 5 m 16 sec
Reputation Power: 0
Send a message via MSN to maddog39
Quote:
Quote:
I dont think alot of people here have a clue about what they are talking about. The statement about OpenGL being used for more games is utterly wrong.

Can you point this statement out?

Certainly, the author of this topic said it in his or her initial post:
Quote:
Originally Posted by BlackNine
Hey everyone,

I am planning on making a 3d game soon. But I would like to know which is better to use. OpenGL is used for most games, but d3d seems cool too. Anyone know which is better?

BTW, I am going to be using this with C++.


Quote:
Well, this is a really a chicken and egg problem, isn’t it? It’s not just DirectX that’s problematic. It’s the fact that non-trivial programs require OS specific code. To that end, you either write your program in an API with a cross platform layer that has OS specific implementations, or one that is directly OS specific itself.

Well considering the libraries that a very large majority of games use for other things, such as OpenAL and SDL which are already designed to be cross platform libraries, the ONLY thing holding them back is DirectX.

Reply With Quote
  #12  
Old August 2nd, 2007, 04:06 PM
calpol2004's Avatar
calpol2004 calpol2004 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 249 calpol2004 User rank is Sergeant Major (2000 - 5000 Reputation Level)calpol2004 User rank is Sergeant Major (2000 - 5000 Reputation Level)calpol2004 User rank is Sergeant Major (2000 - 5000 Reputation Level)calpol2004 User rank is Sergeant Major (2000 - 5000 Reputation Level)calpol2004 User rank is Sergeant Major (2000 - 5000 Reputation Level)calpol2004 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 Days 9 h 40 m 44 sec
Reputation Power: 48
Send a message via MSN to calpol2004
It's not that hard to do both, the api's are extremely similar (you can structure your game the same way). just create routines for each graphics library and to use a different one depending on the users settings.

Alot of games do both, it would take a little more effort but if you build your engine with a "wrapper" which will convert your commands into the according api commands for each type it shouldnt be a problem at all.

for example in your code you could have something like DrawRect() with could be defined as (pseudo):

Code:
DrawRect(x,y,attrib)
{
       if(DirectXvar == 1)
       {
             //DirectX routine here
       } 
       else {
            //opengl routine here
       }
}
}


You get the idea, by building wrappers for each of your instructions you can build an engine which can do both.

If you want to do just the one though i'd go with DirectX unless your using a low level language. If your coding in C or assembly then i'd use openGL as it's easier to program in a procedural environment than DirectX.

Last edited by calpol2004 : August 2nd, 2007 at 04:12 PM.

Reply With Quote
  #13  
Old October 1st, 2007, 02:38 PM
Thr3ddy's Avatar
Thr3ddy Thr3ddy is offline
Harbinger of Harbingers
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2004
Location: Coral Springs, Florida, USA
Posts: 876 Thr3ddy User rank is Captain (20000 - 30000 Reputation Level)Thr3ddy User rank is Captain (20000 - 30000 Reputation Level)Thr3ddy User rank is Captain (20000 - 30000 Reputation Level)Thr3ddy User rank is Captain (20000 - 30000 Reputation Level)Thr3ddy User rank is Captain (20000 - 30000 Reputation Level)Thr3ddy User rank is Captain (20000 - 30000 Reputation Level)Thr3ddy User rank is Captain (20000 - 30000 Reputation Level)Thr3ddy User rank is Captain (20000 - 30000 Reputation Level)Thr3ddy User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 47735 Folding Title: Beginner FolderFolding Points: 47735 Folding Title: Beginner FolderFolding Points: 47735 Folding Title: Beginner Folder
Time spent in forums: 1 Week 6 Days 46 m 24 sec
Reputation Power: 251
Lightbulb OpenGL

Recently I've started to step away from DirectX simply because of the lack of cross-platform compatibility. If you have the option to exploit multiple operating systems with one single API, why not?

GLUT and OpenGL are very powerful tools to use in game development and if a major game developer has used it successfully over the last decade, why not give it a shot?

I'm not throwing DirectX out of the window but OpenGL seems like a wiser choice for me at the moment.
__________________
Regards,
Eddy Luten.

Information: C, C++, STL, Boost, OpenMP, Scriptionary, Google
Book of the moment: Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, John M. Vlissides

This post and all subsequent posts by "Thr3ddy" are licensed under the Creative Commons Attribution United States License 3.0: attribute "Eddy Luten" for any code used which was extracted from "Thr3ddy's" posts.

Reply With Quote