OpenGL vs. DirectX: A ComparisonWritten 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 contains tools to deal with such components of a game as 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?
Well, first things first: 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. Although it has been modified in slight ways to adapt with advancements in hardware, the basic idea remains intact.
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 is a difference in how each API handles how vertices are combined to form primitives.
There are a bunch of differences in the DirectX and OpenGL APIs, so I will list a few of those for you. This chart is based off the book, ÒOpenGL Game Programming,Ó and a few of these may now be incorrect as new DirectX versions are released. If you wish to correct me, please do via one of the ways listed at the end of this tutorial.
|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 then, feel free to contact me via the cprogramming boards as RoD, or via my email at firstname.lastname@example.org
Until next time, happy coding!
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Web Development Articles
More By Developer Shed