View Full Version : How was OpenGL written? (For C)

07-02-2017, 05:13 AM
Hey, everyone! As it is my first forum post, I'd like to ask you all how OpenGL for C was written. I don't want to know how it was compiled, but how the graphics were made. I can't figure out how to make a series of dots look like a line, can anyone help me with this? Any help would be very much appreciated and have a great day.

07-02-2017, 06:45 AM
OpenGL is not a software library.

OpenGL is a graphics API, typically described as "a software interface to graphics hardware", and it is implemented in the device driver for your graphics hardware. Each GPU vendor has their own implementation.

Your program makes OpenGL calls, your GPU's device driver takes those calls and converts them to something your GPU can understand, then your GPU does the actual drawing.

That last part is important. The specific thing you're asking, that doesn't happen in software, it happens in hardware. OpenGL doesn't do it, OpenGL just provides a way for your program to tell your GPU to do it.

07-02-2017, 09:14 AM
You can browse the source code of an implementation (https://cgit.freedesktop.org/mesa/mesa/tree/), including software (https://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/swrast) rasterizers (https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/swr/rasterizer/core).

07-02-2017, 01:48 PM
Please note that pure software-only implementations will typically give you single digit framerates. They're useful for educational or instructional purposes (or for scenarios where functionality is more important than performance), but you shouldn't view them as being anything like how a hardware-based implementation works.