I read some article said OpenGL Context is create by GUI server, but how does OpenGL read it? Is an OpenGL implementation cross-platform?
Asked
Active
Viewed 60 times
0
-
2OpenGL is not a library, it is a specification ([OpenGL specification - Khronos OpenGL registry](https://www.khronos.org/registry/OpenGL/index_gl.php) ). The OpenGL API is implemented by the graphics driver. – Rabbid76 Sep 20 '20 at 17:01
-
And why context is generate by GUI server? and how does OpenGL implementation read context? – Sep 20 '20 at 17:02
-
1Where did you read that? – Rabbid76 Sep 20 '20 at 17:02
-
@AlanJian: The implementation *is the context*. Or rather, the context represents the implementation. – Nicol Bolas Sep 20 '20 at 17:03
-
The context section in OpenGL's wikipedia – Sep 20 '20 at 17:03
-
Does the wgl, glx... request a OpenGL implementation for its context format from driver? – Sep 20 '20 at 17:31
-
Does this answer your question? [How does OpenGL work at the lowest level?](https://stackoverflow.com/questions/6399676/how-does-opengl-work-at-the-lowest-level) – Peter O. Sep 21 '20 at 03:22
-
So, could you explain the relation ship of operating system, OpenGL and something like wgl? and why context is specific platform? – Sep 21 '20 at 11:45
1 Answers
2
An implementation of OpenGL is the actual code that implements the OpenGL specification. An OpenGL context is a particular interface to an OpenGL implementation, along with whatever state data and objects are needed for that interface.
OpenGL does not "read" the context; OpenGL is the context. Without a context, there is no interface to a valid OpenGL implementation, and without a valid OpenGL implementation, there is no OpenGL.
Implementations are specific to the hardware that they are written for.

Nicol Bolas
- 449,505
- 63
- 781
- 982
-
So does the GUI server request an OpenGL implementation specific its context from driver? – Sep 20 '20 at 17:12
-
@AlanJian: I don't know what your question means. It's not clear what you're trying to understand. – Nicol Bolas Sep 20 '20 at 17:13
-
Does the wgl, glx... request a OpenGL implementation for its context format from driver? – Sep 20 '20 at 17:15
-
@AlanJian: I don't know what a "context format" is, but the OS acts as the intermediary between the user and the driver in terms of OpenGL context creation. That is, the user asks the OS to create a context, and the OS selects a driver to ask to create a context. – Nicol Bolas Sep 20 '20 at 17:36