Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an OpenGL Extension Library, Loading Library, Binding Library?

Tags:

opengl

What is an OpenGL Extension Library, Loading Library, Binding Library?

Why are they needed?

Can you explain in easy and plain layman's terms?

like image 922
user366312 Avatar asked Jun 25 '15 20:06

user366312


People also ask

What is OpenGL extension?

OpenGL extensions are a means for OpenGL implementations to provide new or expanded functionality that the core of OpenGL does not provide. Using extensions should not be looked on as something to be avoided; it should be accepted as standard practice for the OpenGL user.

What is glad used for?

1[not before noun] pleased; happy “I passed the test!” “I'm so glad (for you).” She was glad when the meeting was over. glad about something “He doesn't need the pills any more.” “I'm glad about that.” glad to know, hear, see… I'm glad to hear you're feeling better. glad (that)…

Do you need glad for OpenGL?

Be sure to include GLAD before GLFW. The include file for GLAD includes the required OpenGL headers behind the scenes (like GL/gl. h ) so be sure to include GLAD before other header files that require OpenGL (like GLFW).

What is the GLFW library?

GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan development on the desktop. It provides a simple API for creating windows, contexts and surfaces, receiving input and events. GLFW is written in C and supports Windows, macOS, X11 and Wayland.


1 Answers

The first thing to understand is that OpenGL is just the specification of a set on methods to interacts with your GPU. Then if you are on windows or linux, your GPU vendor will provide a driver that comes with an implementation of this specification. If you are on OSX, the implemetation is shipped with your OS.

To use OpenGL, you need an OpenGL context. It is essentially some memory that will hold the current state of OpenGL internal state machine. To create such context, you should use a binding library like glfw or freeglut.

Then you need to access the OpenGL methods. On Windows, you have opengl32.dll​ library that gives access to legacy OpenGL1.1 only ! If you want to use modern OpenGL, you need to get the pointers to the functions exposed by the driver. There are several loading library for that. I think the most common one is glew.

OpenGL allows GPU vendors to provide custom extentions to the specification. You can retrieve these functions the same way you do for normal OpenGL functions. Once again, I would recommand to use glew which is also a extention library.

Then you need a header to have the prototypes for all these functions. But glew also handles that actually.

like image 165
Guillaume Gris Avatar answered Oct 06 '22 08:10

Guillaume Gris