Menu
I know this is probably a very subjective question, but I just want to start with the one which is the easiest and fastest to learn, so that I can get started with a small project of mine as fast as possible, it's a a little 2D game, to start with at least.. Which one would you recommend me to go with? And I'm using C++
Zedayne
Aug 2, 2012 - In short: OpenGL is faster than DirectX. As for why OpenGL is faster than DirectX/Direct3D, the simple answer is that OpenGL seems to have a smoother, more efficient pipeline. At 303.4 fps, OpenGL is rendering a frame every 3.29 milliseconds; at 270.6 fps, DirectX is rendering a frame in 3.69 milliseconds. OpenGL is a cross-platform, language independent API that is similar in objective to Direct3D and Direct2D. Unlike the DirectX suite from Microsoft which is implemented in C++ and has bindings for other languages such as C#, OpenGL has no reference implementation.
closed as not constructive by Nicol Bolas, Bo Persson, the Tin Man, competent_tech, EdChumJan 8 '13 at 0:04
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.
6 Answers
First question: Are you on Windows? If not, use OpenGL.
If you're on Windows, this will come down to a matter of taste. The APIs are different, but the concepts required are very similar for both OpenGL and DirectX. Most things are supported on both, although they do work a bit differently.
Microsoft provides quite a few samples and a decent framework you can use for DirectX (9 or 10), which can make it easier to get started.
That being said, if you're targetting Windows Vista/Win7 only, moving to DirectX 10 may make life easier. A lot of the annoyances in DX9 and earlier were removed in DX10, and the API is a bit more clean.
That being said, if this is for a game, I'd recommend looking at using a middleware engine like Ogre instead of writing directly in DirectX OR OpenGL. This will make your life much simpler, especially while learning.
Reed CopseyReed Copsey
I haven't used DirectX, but OpenGL is fairly simple and there are some good beginner's tutorials at NeHe. Also, if you even want to go cross-platform, you'll need OpenGL.
However, DirectX isn't just a graphics library, you can also use it for sound, etc. so it's probably worth looking into.
However, DirectX isn't just a graphics library, you can also use it for sound, etc. so it's probably worth looking into.
rpjohnstrpjohnst
If it's just 2D, then perhaps it might be worth looking into SDL, which is already cross platform and seems pretty easy to learn. There are many tutorials on the net, but one particular site I remember is Lazy Foo's SDL Tutorials. You can also mix OpenGL with SDL, there are tutorials for that as well.
If you don't want to use SDL, and you are on windows, I would recommend DirectX. I do recognize that the choice between them ultimately ends up in a flame war pretty much anywhere on the Internet, but my understanding is that DirectX is geared towards game developers, so you will find many utility libraries, functions, and classes that might facilitate various tasks. With OpenGL, you would have the ability to write cross platform code, provided that the helper functionality such as image loading is also cross platform (For which there are indeed cross platform libraries).
So my bottom line is: Both are fine, OpenGL gives you cross platform code (Provided you write it), and DirectX gives you more game development oriented tools and libraries.
Jorge Israel PeñaJorge Israel Peña
If it's all about getting started as fast as possible, I'd recommend OpenGL on a NVidia GPU. You can throw almost anything at it and it will display something. However, if you want to achieve decent performance with low programming effort, I'd recommend Direct3D. There are too many ways to do things in OpenGL, and beginners will most certainly discover the slow paths first since they are covered by many ancient tutorials (see NeHe). Additionally, debugging OpenGL apps is painful, although tools like gDEBugger can help.
Malte ClasenMalte Clasen
If you have some COM experience and it does not make your head hurt I'd recommend DirectX, just because SDK has a lot of good examples/tutorials right out of the box. If you better prefer more C-style programming or are confused with COM stuff then I'd say OpenGL.
VorberVorber
As pointed out by several of other people, If you are planning to port your 'Game' to other platforms other than windows, you better start using OpenGL.
If it is just a simple 2D game, and you won't need a 3D support for now, SDL would be a better choice, later you can combine 'SDL' and 'OpenGL' together. ( you can directly use openGL from SDL, it even has it's own header in SDL ).
At the same time, DirectX offers features that neither OpenGL, nor SDL can give you. OpenGL is way behind DirectX. [ OpenGL 3.0 is nothing more than an incremental update, the API hasn't changed much since 2.x ].
So if you are planning to write a game for windows, just use 'DirectX', if not 'OpenGL' and 'Sdl'.
Finally if you aren't looking for headaches just use a GameEngine, e.g. C4 Engine. Believe me when you go for 3D you have no choice, since there are so many topics that will need a lot of time to 'Dig' and 'Learn'.
CynicsCynics
Posted by6 years ago
Archived
Software vs. OpenGL vs. DirectX vs. I'm confused.
I know this sounds like the most basic of pc questions and I seem like a complete nooby but I am a little confused about when a game asks what you want it to use when rendering?
Whats the difference between software and OpenGL and DirectX and DirectX 9? 10? 11? (Some of this may not relate hear me out)
I bought Half Life over the weekend and was fiddling with some settings because my computer sucks so bad I wasn't getting the frames I wanted (Don't freak out I was getting like 30 my computer is still the shittiest piece of shit ever, but it works a little bit I guess)
Anyway I went into the settings and changed the renderer thing to Software instead of OpenGL and it worked like a charm? Then I went and played Killing Floor (A game I struggle to run on low res lowest settings)
And then I switched the renderer thing in Killing Floor to DirectX instead of DirectX 9. (There was also a Software option but then I changed it to software and it wouldn't load up the game because of a C++ error I dont know)
Anyway on DirectX that game became much more playable after that. Why does this happen? And specifically what do all these things mean because I am a bit confused.
80% Upvoted