<blockquote>
<p>…when I invoke draw API in openGL who does the actual job of drawing/coloring of the actual pixels on the screen?</p>
</blockquote>
<p>The GPU does. (At least, if there is one; there are also “software” OpenGL implementations which use the CPU alone.)</p>
<p>But there are intermediate steps between “called an OpenGL function” and “drawing is performed by the GPU”; the GPU does not know what to do with OpenGL functions. (Once upon a time, this might have been less true, but today, GPU architectures are very different from the basic concepts of OpenGL.)</p>
<blockquote>
<p>Does openGL has library implementation of draw that sends the instructions on how to draw shapes? or draw API hits the graphics processing unit …</p>
</blockquote>
<p>When you load the OpenGL API, you get a set of functions that were provided by the installed OpenGL implementation. Those functions may do <em>whatever they want</em> as long as the end result is drawing stuff according to the OpenGL specification.</p>
<p>In the typical case, those functions are provided along with the GPU driver by your GPU vendor, and those functions, when they execute inside your program, translate the OpenGL instructions into something that better suits the specific GPU model you have, then use system calls to send those translated instructions to the GPU <em>driver</em> (which handles requests from all the separate programs asking to use the GPU).</p>
<p>The GPU driver will then send those translated instructions to the GPU over the system bus, and the GPU executes them, causing shapes to be drawn into GPU framebuffer memory. (That framebuffer will then end up sent to the actual video output, on a separate schedule. And there may be additional steps such as window composition before a single application's content appears on screen.)</p>
<p>But all of the details of how all of this works are <em>not part of the OpenGL API</em> — OpenGL just says “if you call these functions in the right way, there will be a picture”, and leaves it up to the implementation to choose a means.</p>

CC BY-SA 4.0
2024-04-12T15:46:54.787Z
great that helps, can you also suggest a structured learning blog/videos/course for understanding the above and the flow in more detail that also talks about all the things that a GPU does to draw the shape on screen.
Himanshuman
CC BY-SA 4.0
2024-04-13T15:56:32.510Z
@Himanshuman No, I don't have any recommendations (I don't tend to learn things myself that way), and that's off-topic here.
Kevin Reid
CC BY-SA 4.0
2024-04-13T16:17:29.480Z
Discussion in the comments regarding learning material for the on question  topic is off topic? Okay if you say so! All I wanted to know was how exactly to learn the above things and from where?
Himanshuman
CC BY-SA 4.0
2024-04-13T17:59:14.000Z
@Himanshuman [Requests for off-site resources are off-topic](https://computergraphics.stackexchange.com/help/on-topic) here and on most Stack Exchange sites. (Answers _may_ contain links to further resources on the topic asked about, but as I said, I don't myself have any to recommend.)
Kevin Reid
CC BY-SA 4.0
2024-04-12T15:03:51.227Z
2024-04-12T15:03:51.227Z
Kevin Reid
<p>I am sorry if the question is too basic but I am just starting with the graphics library. My question is when I invoke draw API in openGL who does the actual job of drawing/coloring of the actual pixels on the screen?</p>
<p>Does openGL has library implementation of draw that sends the instructions on how to draw shapes? or draw API hits the graphics processing unit of the computer eg Intel graphics or Nvidia graphics and it is the job of theirs to actually draw the content on screen. Is it them who has the API which ultimately gets hit when a draw API gets called?</p>
<p>How does the flow actually look like here?</p>

<opengl><gpu>
Who does the actual drawing when I call openGL draw API?
Himanshuman
# Who does the actual drawing when I call openGL draw API?

(Asked by: username_0 on 2024-04-12)

I am sorry if the question is too basic but I am just starting with the graphics library. My question is when I invoke draw API in openGL who does the actual job of drawing/coloring of the actual pixels on the screen?

Does openGL has library implementation of draw that sends the instructions on how to draw shapes? or draw API hits the graphics processing unit of the computer eg Intel graphics or Nvidia graphics and it is the job of theirs to actually draw the content on screen. Is it them who has the API which ultimately gets hit when a draw API gets called?

How does the flow actually look like here?

**Tags:** opengl, gpu


---

## 1 answers

### Answer by username_1 on 2024-04-12. Score: 1 | Accepted answer

> …when I invoke draw API in openGL who does the actual job of drawing/coloring of the actual pixels on the screen?

The GPU does. (At least, if there is one; there are also “software” OpenGL implementations which use the CPU alone.)

But there are intermediate steps between “called an OpenGL function” and “drawing is performed by the GPU”; the GPU does not know what to do with OpenGL functions. (Once upon a time, this might have been less true, but today, GPU architectures are very different from the basic concepts of OpenGL.)

> Does openGL has library implementation of draw that sends the instructions on how to draw shapes? or draw API hits the graphics processing unit …

When you load the OpenGL API, you get a set of functions that were provided by the installed OpenGL implementation. Those functions may do *whatever they want* as long as the end result is drawing stuff according to the OpenGL specification.

In the typical case, those functions are provided along with the GPU driver by your GPU vendor, and those functions, when they execute inside your program, translate the OpenGL instructions into something that better suits the specific GPU model you have, then use system calls to send those translated instructions to the GPU *driver* (which handles requests from all the separate programs asking to use the GPU).

The GPU driver will then send those translated instructions to the GPU over the system bus, and the GPU executes them, causing shapes to be drawn into GPU framebuffer memory. (That framebuffer will then end up sent to the actual video output, on a separate schedule. And there may be additional steps such as window composition before a single application's content appears on screen.)

But all of the details of how all of this works are *not part of the OpenGL API* — OpenGL just says “if you call these functions in the right way, there will be a picture”, and leaves it up to the implementation to choose a means.

> **Comments:**
> **username_0**: great that helps, can you also suggest a structured learning blog/videos/course for understanding the above and the flow in more detail that also talks about all the things that a GPU does to draw the shape on screen.  
> **username_1**: @username_0 No, I don't have any recommendations (I don't tend to learn things myself that way), and that's off-topic here.  
> **username_0**: Discussion in the comments regarding learning material for the on question  topic is off topic? Okay if you say so! All I wanted to know was how exactly to learn the above things and from where?  
> **username_1**: @username_0 [Requests for off-site resources are off-topic](https://computergraphics.stackexchange.com/help/on-topic) here and on most Stack Exchange sites. (Answers _may_ contain links to further resources on the topic asked about, but as I said, I don't myself have any to recommend.)  

---

