Most people have no clue as to what DirectX or OpenGL actually is. Most people know DirectX as “the thing I need to run my games”. I felt it was time to write an explanation that clears up exactly what DirectX and OpenGL are. Below is a simple “stack” diagram to show how the layers between your Graphics Card (NVidia; ATI; Via; Intel; S3; etc.), and your Games fit together:
Going from the bottom layer (your hardware), to the top layer (your Games): the first layer is the “Hardware Abstraction Layer”. This layer is provided by the Operating System (Windows, Linux or Mac OS), and allows Device Drivers to “talk” to the hardware by sending and receiving data and commands. It’s a bit like your web browser sending and receiving data to a web site on the internet.
However, each graphics chipset has a different protocol (think of it like a language) that it understands. Thats where the Device Driver layer comes in. The Operating System defines a set of standard language and set of commands that the Device Driver must provide to the Operating System. The Device Driver is responsible for translating those “Operating System Commands” into a the protocol that the actual Graphics Card can understand. A bit like a human translating between two languages.
However, generally a Graphics Device Driver for an Operating System generally has a very minimal set of commands for basic 2D operation (things like “draw this picture over here”; “draw a line here”; etc.), because there are still many graphics cards in the world that don’t support the complex operations expected by an advanced 3D Game. To compensate for that, DirectX and OpenGL provide an extended set of commands for doing complex 3D operations (like “draw a polygon”; “move the camera like this”; etc.). Why make the Graphics Hardware do this? Having Hardware perform an operation is almost always faster than having software do it, thus the term “3D Hardware Acceleration”. DirectX and OpenGL give software (like Games, a level editor, or a 3D modeling package) access to the more advanced features a Graphics Card may provide. You might think of them as an “Advanced Device Driver”.
- What is the difference between OpenGL and DirectX?
- What does “DirectX 7/8/9/10 Compatible mean”?
- Why is there only “OpenGL 1 and 2”?
- Why is there no such thing as an “OpenGL Compatibly” Graphics Card?
Well, I’ll be answering those questions in my next post.