Shall I become a DirectX or OpenGL beginner?

Started by
16 comments, last by popsoftheyear 15 years, 5 months ago
Why not try learning both, and then decide when you have some experience using the APIs. Then you can make the decision that is best for you.

[Hardware:] Falcon Northwest Tiki, Windows 7, Nvidia Geforce GTX 970

[Websites:] Development Blog | LinkedIn
[Unity3D :] Alloy Physical Shader Framework

Advertisement
Since you have already started with OpenGL, stick with that. The API is nothing but a tool. Work on learning the concepts instead and apply them in projects you find interesting. At times you will find yourself overwhelmed but you just have to persevere - the results will be extremely rewarding! :)

A word of advice: there are simply too many APIs, engines and libraries to choose from. Everyone will have a personal preference and it is very easily to get lost in the choices (all of us have suffered from this one time or another). The solution? Start simple and stay focused.

To sum it up, stick with OpenGL. You will know when it will be time to move on.

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]

Quote:Original post by Neptune
I personally like DirectX because that's the one I originally learned to use. But, now I'm wondering if OpenGL would be just as good. Does anyone know if OpenGL is used in any major games on the market?


A: yes, ID's Quake series.
Quote:Original post by Captain P
Quote:Original post by furnace
I wrote quite a long post initially, but here's a short version saying exactly what I want to say, just without the blah!

:)

I'd say, stick to OpenGL. Especially for a first game, any differences in capabilities are not going to hinder you anyway (simplistically said, if one is capable of pushing 10.000 poly's and the other 100.000, does it matter if your game only needs 1.000?).


But actually, OpenGL is probably too low-level if you just want to get a game done. Take a look at SDL, Allegro or Haaf's Game Engine. Much of the core functionality that most games need is readily available in the form of frameworks and engines, so pick one that's suitable and go with it. Hey, I've even seen some great games built with Gamemaker, and personally, I prototype a lot in Flash and also Python. It's relatively quick and easy to work with so I go with it. :)

Yeah I was going to suggest something similar. Using XNA since he'd be able to easily recompile his game for his Xbox if he wanted using XNA. Actually, with XNA 3.0 now you can also make the game for Zune too now!


[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Quote:Original post by furnace
- I have an idea for a game that only I will probably ever play, and will be developed for Windows.


I write/make stuff for myself (on games like StarCraft) all the time. Programming (C specifically) and "map editors" (I also build them, like ID Software's Commander Keen: Marooned on Mars, 1991).

I think it's very cool, and interesting that you'd say that right off the bat.

Quote:Original post by furnace
- It will be my first game.


I hope you enjoy it and are proud of yourself in that case; My first "game" was textual 100%. Sort of like Snake (using the window's console, which can be ported to Linux with ease).

Quote:Original post by furnace
- My job is in application and internet development and I know enough to be confident that I can actually do this.


Your job is in "Application and Internet Development?" Which means you program HTML, Java, MySQL (scripts and variations thereof)?

Quote:Original post by furnace
- I already know very basic OpenGL, e.g. I can draw triangles and move them.


I bought "The OpenGL Superbible" in 1996? when the man wrote it. It is very descriptive (I also have his second edition, was quite interested when he made the third). If you were really interested in learning OpenGL, I'd suggest that book.

I also know OpenGL; Not the worlds most advanced concepts and usages but, I know enough to entertain myself with 2D games (I'm a personal fan of 2D and believe *most* 3D games that just use the same "game engine" are of a lacking interest).

Quote:Original post by furnace
- I don't know any DirectX.


Learning DirectX is very! Easy! DirectX requires you know (the worlds most *basic* Win32 knowledge. AKA "CreateWindow" function call and you're done).

Quote:Original post by furnace
- I don't want to learn OpenGL if DirectX is "miles ahead" or OpenGL is not "worth" learning for any reason.


OpenGL has a long history, and alot of variations. It is an OPEN SOURCE language. You can feel free to modify, update, change, and share it - This means *anybody* or a group thereof can modify it and better it (if needed).

DirectX was released in 1995 and has been being updated ever since. The "X-Box" (originally called DirectX Box, was code named "X-Box" and it stuck) is based purely on DirectX, and was probably DirectX's first (and personally, only) feat in the 3D-graphics world.

OpenGL and DirectX are what, most people, would call "evenly matched."

Here's an example of that question (slightly changed from API to language):
Which is faster? Assembly or C?

The answer: Assembly.
Now which can be produced faster? C of course (all depending on what you're doing).

Assembly gives you alot more control (as does OpenGL), due to the simple fact that it is a lower-level language. Which more control comes more "responsability" of doing stuff and taking care of stuff. DirectX is more abstract (general) than OpenGL and "takes care of" stuff for you, but with that you lose control over how it is does (internally and what-not).

The performance may suffer, but with the sheer processing power of todays computers, it is insignificant - For games like America's Army, Spore, World of WarCraft (resource sucking & demanding games), the end-toll might be 5 FPS difference which doesn't really matter because the average human brain only sees 60 FPS (registering and what-not). You might see it herk and jerk if it's running at 25 FPS and drops to 20 FPS for a moment (you exited a building and the land had to load in the distance with "fog").

Quote:Original post by furnace
- I'm worried about DirectX keeping me bound to Windows, but in reality, I'll only ever write a Windows game anyway, and the only console I own is an xbox 360.


Switching from high-level language to high-level language is basically the same thing, all the syntax is about the same, all the commands are very similar (although there is always a unique attribute here and there).

OpenGL is cross-platform compatible, while DirectX (obviously) is Windows only. If you're planning on trying out other operating systems (or have friends who use them) you might want to look at OpenGL.

But in the end, I personally believe you should learn (at minimal) the basics! Of both APIs.

Quote:Original post by furnace
So, what do you think...

Do I build on the very basics I've already learnt in OpenGL, or do I start again and learn Direct3D/DirectX?

Thanks for your opinions!


I think you should (at first) persue OpenGL and finish your "Windows-only" game (and assuming you write it in OpenGL, you can show all your friends!!) then learn DirectX a little-bit, and make a decision of which you prefer, or like better.

Finally but not least: I wrote all of that because I don't believe people should make a single lined post (especially! When 14 other people have done it before, joining band-wagons accomplishes nothing, other than creating a false-sense of "peer-pressure"), if you have something to say, say it!
“You may be disappointed if you fail, but you are doomed if you don't try.”Beverly Sills
Quote:It's been said here and in many other places OpenGL has been rapidly losing the 3D API wars for some time now and will probably continue to do so in the future. As such, it makes little sense to invest a lot of time and effort into using a system with a limited future ahead of it. Hell, John Carmack himself has really abandoned ship with id Tech 5.

incorrect, id tech 5 is still solely using opengl on the pc

the future of opengl is better now than it was say 3 years ago

A/ google etc use ogl (exclusively I believe)
btw heres a new app I saw today on the news http://news.bbc.co.uk/1/hi/technology/7725560.stm
I wouldnt be surprised if the number of hours spent on this and other similar stuff eg google earth (400million downloads btw, what game even comes close to that) top the number of hours playing games

B/ apple uses opengl exclusively, apples marketshare has been growing far greater than normal? pc stuff

C/ all iphones + new ipods use opengl for the 3d rendering
Thanks for the great response everyone :)

I've read through all of your replies (I was suprised to have so many good responses). I think, as I know something about it already, I will continue playing with OpenGL and get more comfortable with that. It's reassuring to hear that similar theories apply to both APIs so I needn't worry too much about wasting time learning either one of them.

It's interesting that Ogre3D was mentioned as I have skimmed over the manual of that already. But I think I would like to play directly with the APIs before using any kind of abstraction.

@MuTeD - I wouldn't start with HTML, I hate it when people call that programming! But yeah I'm paid to use PHP, MySQL, VB.Net and the inevitable follow-ons from that (html, &#106avascript, ajax, bits of C#, and so on). I also have two evening course qualifications in C++ and one in VB.Net all at Distinction level, and a software development diploma (which is worthless really, anyone could have passed the diploma). I've written various applications in both spare time and work time, but never a game.

Thanks again to all of you for your replies. I'm sure I will keep you updated when I learn new things and come across new problems!
Quote:Original post by MuTeD
Finally but not least: I wrote all of that because I don't believe people should make a single lined post (especially! When 14 other people have done it before, joining band-wagons accomplishes nothing, other than creating a false-sense of "peer-pressure"), if you have something to say, say it!

While I empathize with wanting to help, all those lines you felt you needed to say were for the most part, completely incorrect - no offense! I only bring it up because you may have confused the OP.

To touch a few points:
- OpenGL is not OPEN SOURCE, it is an open standard. You can not, normally, get the "source code" to an opengl implementation, as there will most likely be a different implementation on every different piece of hardware.
- DirectX vs. OpenGL = C vs Assembly is wrong in so many ways.
--- C is not "faster" than assembly. One can make an assembly program that runs slower than its C equivalent - quite easily these days what with pipelining concerns etc...
--- OpenGL is not faster than DirectX. In fact the paths taken in DirectX can sometimes yield better results than the equivalent logic worked out in the way you would in OpenGL. This doesn't necessarly mean DirectX is "faster" than OpenGL either. They are just two APIs for accessing graphics hardware.

Anyway, furnace, if you think that only you will ever play the game, why not go for something like Ogre or another higher-level abstraction so that you can whip that game out faster. I doubt that you will find yourself limited, and it will probably do whatever you are aiming for better than you would be able to do it (at least on your first few attempts), and will save you loads of time. Although I understand, as I'm a pretty stubborn person and have only recently warmed up to "other people's" code.

Either way, have fun and good luck!

Cheers
-Scott

This topic is closed to new replies.

Advertisement