How does it work?

Started by
2 comments, last by Bromordra 13 years, 6 months ago
Hey all, Not sure if this is a 'for beginners' question really, as I'm not asking for help or advice really, so if it needs be moved, move it along.

My question is how exactly do DirectX, OpenGL or any other low-level graphics library actually work? I understand that they communicate with the hardware and tell them what to draw and where and all that other whatnot. What I'm asking is how exactly is that accomplished? Like what does the code look like?

Note I'm not saying I actually want to create one of these myself or anything, I'm quite fine to work with the ones existing, I've just always been curious as to how they are accomplished.
Advertisement
Short answer, it's somewhat different for every card. Each manufacturer authors their own drivers that implement the OpenGL/DirectX APIs to work specifically for their hardware.

It looks like hardware device driver code; you're basically directly controlling the hardware and transforming the data into byte-streams that the hardware can deal with. It's something you can only really do if you know exactly how the hardware works, most of which is publicly undocumented.
OpenGL and Direct3D define their interface at the application level, they don't do any low-level hardware stuff. It is up to the hardware vendor to wrap the hardware level details inside their OpenGL or Direct3D implementation. This implementation is usually shipped as part of the driver package that you install for your specific video card.
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
Quote:Original post by CodeMunkie
OpenGL and Direct3D define their interface at the application level, they don't do any low-level hardware stuff. It is up to the hardware vendor to wrap the hardware level details inside their OpenGL or Direct3D implementation. This implementation is usually shipped as part of the driver package that you install for your specific video card.


Okay that makes sense. I suppose I was operating under a misconception about what exactly the libraries/APIs did. Thanks.

This topic is closed to new replies.

Advertisement