What_Is_Opengl.md - z22756392z/wp109b GitHub Wiki

OpenGL is a graphics API.

API stands for application programming interface and what it is is a bunch of functions that we can call to do certain things.

In this case, it(graphics API) allow to do things with graphics.

And specifically OpenGL allow us to access to the GPU graphics processing unit which is graphics card.

And of course being called graphics card, it is pretty good at drawing graphics.

And so in order to utilize this massively powerful graphics processor that we have in either a computer or a device like a phone we need to use some kind of API to get access to that actually hardware and OpenGL is one of many API(Like direct3d, Vulcan, metal...).

So in summary OpenGL allow us to control our graphics card to a certain extent.

Misunderstanding about OpenGL

OpenGL is not a library, an engine nor a framework.

OpenGL by itself at its core is a specification that lists hey this function should exist it should take these parameters that should return this value.

it is just specification what you can do.

There's no implementation there.

There's no code for itself.

Who write the code that gets called when we call an OpenGL function

The GPU manufacturer.

So if we are using the NVIDIA GPU then the drivers for that GPU our NVIDIA drivers are what actually contained the implementation of OpenGL and video implementation of OpenGL.

Every graphics card manufacturer AMD, intel.... They have their own implementations.

So everyone's implementation of OpenGL is slightly different which is why in a lot of cases some things may work on NVIDIA drivers on a NVIDIA GPU but same game might look a little bit different on a MD TV maybe there are bugs or something.

The point is OpenGL is written by our GPU manufacturer.

Is OpenGL open source

It is not open source.

You can not see the code for OpenGL.

Because, First of all, OpenGL is just a specification. There's no actual source code.

Secondly, its implementation is most probably not open source. Because it is written by GPU manufacturers they certainly don't release their driver source code.

Modern OpenGL and Legacy OpenGL

OpenGL was released in the 90's and it was very different toward what is now.

Back then, GPUs weren't that programmable and flexible.

So Legacy OpenGL is really simple. And is easy to use.

The code is short. And of course it doesn't give us as much control.

Unlike now, especially with other lower-level API, manufacturer are giving us so much control to programmers and developers.

And OpenGL is lot more kind of low-level or it give us a lot more control than it did back then.

And the biggest distinction between Legacy OpenGL and mordern OpenGL is shaders.

Shaders is a program, a code, that runs on our GPU.

So if we write code in C++ or Java or C# or whatever language it run on our CPU.

But since specifically dealing with graphics, it give us more control, and run faster on GPU.

And that's why shaders come in.