robotrage
robotrage

Reputation: 352

How is OpenGL able to work on all architectures and GPU's?

I have been wanting to make a game in OpenGL, c++ for a while now and i would love some explanation on how exactly it works and what it is.

Can computer graphics be made without OpenGL ? most of the tutorials i have seen online show how to use OpenGL for the most basic graphics drawing, it is possible to directly interface with your GPU ?

How does OpenGL work on different CPU's and Operating systems ? As far as i know languages like c++ must be recompiled if they want to be used on an ARM processor and the such, is this not the case for GPU's in general ?

If you can indeed make graphics without OpenGL, does anybody still do this ? how much work and effort does OpenGL save in general and how complex are the systems that OpenGL facilitates for us?

Are there other libraries like OpenGL that are commonly used ? if not, will new libraries eventually come and take it's place or is it perfect for the job and not going anywhere ?

Upvotes: 3

Views: 2444

Answers (1)

Jeysym
Jeysym

Reputation: 186

How exactly it works and what it is?

OpenGL defines an interface that you as a programmer can use to develop graphics programs (API). The interface is provided to you in form of header files that you include to your project. It is meant to be multiplatform, so that you can compile your code that uses OpenGL on different operating systems. People that manage the OpenGL specification do not provide the implementation of specified functionality. That is done by the OS and hardware vendors.

Can computer graphics be made without OpenGL?

Yeah, sure. You can e.g. calculate the whole image manually in your program and then call some OS-specific function to put that image on the screen (like BitBlt in Windows).

How does OpenGL work on different CPU's and Operating systems?

Each OS will have its own implementation of OpenGL specification that will usually call the hardware drivers. So let's say you have machine with Windows OS and Nvidia graphics card. If you run some program that calls glDrawElements it will look like this:

your_program calls glDrawElements
   which calls glDrawElements implementation written by people from Microsoft
       which calls Nvidia drivers written by people from Nvidia
           which operates the HW

If you can indeed make graphics without OpenGL, does anybody still do this?

Yeah sure. Some people might want to implement their own rendering engine from ground up (although that is really hardcore thing to do).

Are there other libraries like OpenGL that are commonly used ? if not, will new libraries eventually come and take it's place or is it perfect for the job and not going anywhere ?

Sure. There is DirectX that is maintained by Microsoft and targets only Windows platforms and the Vulkan that can be seen as successor to OpenGL.

Upvotes: 7

Related Questions