Commands to create, manage and destroy GLC contexts.
Those commands do not use GLC context state variables and can therefore be executed successfully if the issuing thread has no current GLC context.
Each GLC context has a nonzero ID of type GLint. When a client is linked with a GLC library, the library maintains a list of IDs that contains one entry for each of the client's GLC contexts. The list is initially empty.
Each client thread has a private GLC context ID variable that always contains either the value zero, indicating that the thread has no current GLC context, or the ID of the thread's current GLC context. The initial value is zero.
When the ID of a GLC context is stored in the GLC context ID variable of a client thread, the context is said to be current to the thread. It is not possible for a GLC context to be current simultaneously to multiple threads. With the exception of the per-thread GLC error code and context ID variables, all of the GLC state variables that are used during the execution of a GLC command are stored in the issuing thread's current GLC context. To make a context current, call glcContext().
When a client thread issues a GLC command, the thread's current GLC context executes the command.
Note that the results of issuing a GL command when there is no current GL context are undefined. Because GLC issues GL commands, you must create a GL context and make it current before calling GLC.
All other GLC commands raise GLC_STATE_ERROR if the issuing thread has no current GLC context.
| void glcContext |
( |
GLint | inContext | ) |
|
Assigns the value inContext to the issuing thread's current GLC context ID variable.
If another context is already current to the thread, no error is generated but the context is released and the context identified by inContext is made current to the thread.
Call glcContext with inContext set to zero to release a thread's current context.
When a GLCcontext is made current to a thread, GLC issues the commands
glGetString(GL_VERSION);
glGetString(GL_EXTENSIONS);
and stores the returned strings. If there is no GL context current to the thread, the result of the above GL commands is undefined and so is the result of glcContext().
The command raises GLC_PARAMETER_ERROR if inContext is not zero and is not the ID of one of the client's GLC contexts.
The command raises GLC_STATE_ERROR if inContext is the ID of a GLC context that is current to a thread other than the issuing thread.
The command raises GLC_STATE_ERROR if the issuing thread is executing a callback function that has been called from GLC.
- Parameters
-
| inContext | The ID of the context to be made current |
- See also
- glcGetCurrentContext()
-
glcDeleteContext()
-
glcGenContext()
-
glcGetAllContexts()
-
glcIsContext()