OpenGL vs. DirectX: A Comparison

By RoD
The 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!

Perhaps the most obvious difference is that DirectX, as opposed to OpenGL, is more than just a graphics API. DirectX supports sound, music, input, networking, and multimedia. On the other hand, OpenGL is strictly a graphics API. So what aspect of OpenGL sets it apart from the DirectX graphics component?

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

Table 1.1:
Feature: OpenGL DirectX
Vertex Blending N/A Yes
Multiple Operating Systems Yes No
Extension Mechanism Yes Yes
Development Multiple member Board Microsoft
Thorough Specification Yes No
Two-sided lighting Yes No
Volume Textures Yes No
Hardware independent Z-buffers Yes No
Accumulation buffers Yes No
Full-screen Antialiasing Yes Yes
Motion Blur Yes Yes
Depth of field Yes Yes
Stereo Rendering Yes No
Point-size/line-width attributes Yes No
Picking Yes No
Parametric curves and surfaces Yes No
Cache geometry Display Lists Vertex Buffers
System emulation Hardware not present Let app determine
Interface Procedure calls COM
Updates Yearly Yearly
Source Code Sample SDK Implementation

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