OpenGL vs. DirectX: A ComparisonThe competition between OpenGL and DirectX is possibly as well known as the wars waged between AMD and Intel enthusiasts. This topic has sparked the fires of many flame wars throughout the years, and I don't anticipate that changing anytime soon. I won't preach why I prefer OpenGL over DirectX, but rather lay out the facts and let you make that decision. So let's dive in!
One major difference is that OpenGL is cross-platform, and DirectX is available only on Windows and XBox. If you need to develop for more than Windows, OpenGL is the way to go.
When it comes to graphics capabilities, both APIs rely on the use of the traditional graphics pipeline. This is the same pipeline that has been used in computer games since the early days of computer graphics.
Both OpenGL and DirectX describe vertices as a set of data consisting of coordinates in space that define the vertex location and any other vertex related data. Graphics primitives, such as points, lines, and triangles, are defined as an ordered set of vertices. There are differences in how each API handles how vertices are combined to form primitives, which are laid out below.
This chart is based off the book, OpenGL Game Programming
So now you know what separates DirectX and OpenGL, and hopefully you have chosen based on facts which you would prefer, not on myths or opinions. I hope you chose OpenGL, as that's what I will be teaching. If you chose DirectX my tutorials won't help you very much. In the next lesson we will begin with our first OpenGL program.
Until next time, happy coding!
Previous: OpenGL Introduction
Next: Introduction to Windows Programming
Back to OpenGL tutorial index