Pages

Categories

I have been using OpenGL for about 4 years until now, it is really a very good library.  But I heard a lot about DirectX and many of my students began to learn it, so I decided to do a research about it to know why they need something other than OpenGL? 

In my research I read a lot of articles comparing DirectX with OpenGL, but many of them were old, also I didn’t find any article that can tell me everything I want to know.  So I created this post to be an exhaustive, up-to-date comparison between OpenGL and DirectX.

I will compare current version of OpenGL which is OpenGL 3.1 with current version of DirectX (or Direct3D if we want to be more exact) which is DirectX 10. 

1.  Historical View

OpenGL

OpenGL was designed to be a cross platform 2D and 3D Graphics Library, so it doesn’t handle audio or input/output devices but it has many extensions that is made especially to handle this devices.  It was developed by Silicon Graphics Incorporated in 1992. 

OpenGL is no more than 250 commands which can create, manage and render any complicated scene in many fields like CAD, Virtual Reality, flight simulation and video games. 

It is considered a state machine for controlling primitive objects in a scene, so usually programs written in OpenGL are small and efficient. 

DirectX

It was developed by Microsoft in 1995 to be an OpenGL competitive.  It is a kind of API handles multimedia and specializes in games field. 

It is made of a components like Direct3D (3D graphics library included DirectDraw for 2D draw), DirectMusic and DirectSound. 

Nowadays there is not any product that can do all these things that DirectX can do, even though we can find an alternative for every single component. 

2.  Idea

DirectX was designed to be an Interface for the hardware that is provided by graphics card vendors, so it isn’t hide low details from the user.