DirectX and OpenGL

Started by
3 comments, last by Hodgman 15 years, 8 months ago
Recently I've heard that OpenGL 3.0 has been announced, and it's been pretty disappointing. However, I have tried learning DirectX before and it didn't go so well, but now I'm planning to give it another shot. Until now, recently and in the past I have only been making DOS games before, you know, those games that run on a black and white screen. Well now I want to move away from that, because I feel that I'm getting nowhere with making games like that. Also, sadly, I have never made a useful windowed application before, meaning that I have made windowed programs before, but they were basically useless and didn't really do anything. I never really got much into programming with Win32, but now I'm hoping to change this. Anyway, what I wanted to ask you guys is about DirectX and OpenGL. I have quite a few questions really, and I'm hoping that you can answer them. In case you want to know, I'm planning to make my games with C++ but I might make other aplications (not the games but things like level editors, etc) in another programming language for simplicity. My questions: Why are so many game developers disappointed in OpenGL 3.0? It recently came out on August the 12th, am I correct? Although OpenGL 3.0 is a disappointment, do you still recommend learning it? What are the pros and cons of learning it, and what can it do that DirectX can not? What can DirectX do that OpenGL can not? Which API (DirectX or OpenGL) is easier to learn for beginners? What are the pros and cons of using DirectX to create my applications, besides the portability issues? Also, does it seem (backed up with evidence) that more and more people are switching to Vista and being able to play games that are made with DirectX10? Do you see the Windows operating system or DirectX dying in any way, and if so, why? What do you think of using SDL to create my games? Do I need to know the Win32 API in order to create games, and if so, how much of it? Right now I know of several websites that I can go to for learning game programming. These are: directxtutorial.com, nehe.gamedev.net, drunkenhyena.com, lazyfoo.net, and videotutorialsrock.com. What do you think of the tutorials on these sites? Are they accurate? Do they use good programming practice? Recommendations to websites relating to DX, OGL, and SDL will be appreciated. I also hope that you guys can help me answer most of my questions. Thanks in advance.
Advertisement
The anger at OpenGL is actually anger at the OpenGL standards group more than anything. And the anger seems to be mostly because the standards group (called ARB or Khronos usually) promised (or led to believe) OpenGL would be a brand new, totally cleaned up, object-oriented, super-efficient API. That would be great, of course - how could anyone disagree with that? Well, the ARB went silent for a year or more (after leading everyone to believe the next release would blow the socks of everyone in the universe) - then released a version that jumped a whole major version number, but was only incremental improvements on the "old, moldy API" (as those excited about the promises now see it).

But OpenGL is still better than D3D in many minds, either because it is simply better in ways some people care deeply about (but not in other ways they care less about). And if you want to write multi-platform (Windows/Linux/Mac/etc) graphics applications, you have no choice --- OpenGL is the only option.

For the record, I switched from D3D to OpenGL and STILL am very glad I did, and have no temptation to switch back. This is true even though I wrote [most of] two commercial game engines (with released games), and had to learn a new way of doing things "all over again". We must let each person make their own judgement about this, but the anger will die down soon, and OpenGL will continue to be one of the two real options for fast, sophisticated 3D.

I would still suggest OpenGL to anyone starting graphics, any day of the week.

DirectX AKA Direct3D supports a very, very few extra features of the latest graphics cards that "core" OpenGL does not. However, these advanced features are also available on OpenGL, though only through GPU vendor specific "extensions" --- that work perfectly well, but have not been officially added to the official "core" OpenGL.

The primary "pro" of DirectX/Direct3D is --- you like its way of doing things. If you like the way OpenGL does things better, that "pro" goes to OpenGL. With D3D you can write efficient Vista applications. With OpenGL you can write efficient Vista/XP/2000/... applications. The choice is yours.

I believe OpenGL is vastly easier to learn for beginners. However, I suppose this might not be true for everyone. I guarantee you will find some programmers who claim D3D is easier for beginners. I find that virtually impossible to believe myself - yet in truth, I believe them (meaning, I believe there are SOME people who just "take" to certain styles that are more difficult for most people).

Yes, I see the Windows OS dying (and therefore D3D) --- in about 25 years (which is a guess, and too long to worry about). The reason for that will be people just get fed up being trashed by viruses and other problems inherent in Windows AND because a sufficiently large collection of totally free software to do just-about-everything will obsolete the notion of "paying" for mainstream software.

I am not familiar with SDL, because I try to develop everything possible myself. But plenty of graphics programmers will advocate it. I cannot answer whether it is better for you, and doubt anyone else can - unless they know your style, strengths, preferences, etc.

You do not need the Win32 API to create games. You can do everything necessary through a small-to-large collection of function libraries. And if you might ever care about portability, that is a good policy. If you do call some win32 API functions, you may call as few as you wish (see WGL).

I appreciate the effort that people have invested to create tutorial websites, so I hate saying this. I found books that I bought [from www.amazon.com] to be much better than anything I could find on websites. However, having forums like www.gamedev.net to ask questions on can be very helpful (personalized answers!).

I hope this helps a little. You will get totally diverse answers, I can almost guarantee you that!
One short answer is that if you care about using your code on non-Windows systems, OGL is the way to go. Otherwise, it's personal preference. DX is much more OO while GL is more C-style, although there are wrapper libraries which can remove that difference.
Quote:Original post by bootstrap
You will get totally diverse answers, I can almost guarantee you that!
Heh...no kidding
Quote:Why are so many game developers disappointed in OpenGL 3.0? It recently came out on August the 12th, am I correct?
Because it's not actually what they said that GL 3.0 would be. It's really just GL 2.2, but marketing decided that calling it 3.0 would be a good idea (tm)
Quote:Although OpenGL 3.0 is a disappointment, do you still recommend learning it? What are the pros and cons of learning it, and what can it do that DirectX can not?
Yes. GL can run on Linux/Apple/etc...
Quote:What can DirectX do that OpenGL can not?
Not much. DirectX has a nicer OO API though. To easily use GL you will need some other libraries such as GLEE to access advanced functionality.
Quote:Which API (DirectX or OpenGL) is easier to learn for beginners?
One of the bad things about GL is that there is usually more than one way to do something.
Say you have 3 ways to do something - only one way might be really fast.
However, on the flip side, a lot of the time the slow way of doing things is actually easier to learn. So you can use these older methods as a stepping stone if you like.

D3D does come with sample programs and documentation though. GL doesn't "come with" any documentation besides the official specification.
Quote:What are the pros and cons of using DirectX to create my applications, besides the portability issues? Also, does it seem (backed up with evidence) that more and more people are switching to Vista and being able to play games that are made with DirectX10?
DirectX seems to have less driver issues than GL. ATI is renowned for having lots of bugs in their OpenGL drivers.
AFAIK Vista users make up 15% of the market - not enough to justify a "Vista only" game.
Quote:Do you see the Windows operating system or DirectX dying in any way, and if so, why?
It's possible that google could convince the world to start using Linux instead of Windows, which would effectively kill off DirectX.
...but in reality, that's not likely.
Quote:What do you think of using SDL to create my games?
Good for portability.
Quote:Do I need to know the Win32 API in order to create games, and if so, how much of it?
A small amount. You need the code to create a window (which you can copy&paste easily enough), and a few other beginners topics like getting keyboard/mouse input, hiding the mouse cursor, etc...
Alternatively you could use SDL instead of the Win32 API here.

This topic is closed to new replies.

Advertisement