The OpenGL library calls in my source c code are interface to 'something'. What is that 'something' software? Is it device driver of the graphic card in my computer?
-
Tried [wikipedia](http://en.wikipedia.org/wiki/OpenGL) already? – Till Oct 12 '13 at 15:45
-
1[My answer to this question](http://stackoverflow.com/a/10570386/1122135) would answer your question and give you a bit of extra information as well, so I'm going to link to it instead of rewriting a part of it as an answer. – Robert Rouhani Oct 12 '13 at 15:47
-
possible duplicate of [How does OpenGL work at the lowest level?](http://stackoverflow.com/questions/6399676/how-does-opengl-work-at-the-lowest-level) – datenwolf Oct 12 '13 at 16:01
-
2I answered it in detail here: http://stackoverflow.com/a/6401607/524368 – datenwolf Oct 12 '13 at 16:01
1 Answers
You will link your application against the OpenGL library. The library is a set of functions that do things like drawing triangles, turning on lights, etc. The library is also an abstraction of the hardware on your machine. So yes, eventually it calls into the device driver to do some work.
When you call a method such as glTexImage2D()
, you're calling a function in the OpenGL library. That function probably does something to the data you passed it, and then calls the device driver to tell it, "Here are some pixels that describe a 2D image." The driver then copies that data to memory on the card (unless you've set some parameters to tell it that the data can be copied later).
Using OpenGL means you don't have to worry about which brand of video card is in the machine, and you have a consistent interface for drawing 3D graphics across systems.

- 25,567
- 4
- 55
- 86