KawaiKx
KawaiKx

Reputation: 9940

What is OpenGL API interfacing to?

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?

Upvotes: 1

Views: 173

Answers (1)

user1118321
user1118321

Reputation: 26395

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.

Upvotes: 3

Related Questions