OpenGL or DirectX?

Zedayne picture Zedayne · Aug 6, 2009 · Viewed 16.7k times · Source

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++

Answer

Reed Copsey picture Reed Copsey · Aug 6, 2009

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.