Tutorials
Documentation
Global Commands

Functions

GLboolean glcIsContext (GLint inContext)
 
GLint glcGetCurrentContext (void)
 
void glcDeleteContext (GLint inContext)
 
void glcContext (GLint inContext)
 
GLint glcGenContext (void)
 
GLint * glcGetAllContexts (void)
 
GLCenum glcGetError (void)
 

Detailed Description

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.

Function Documentation

◆ glcIsContext()

GLboolean glcIsContext ( GLint  inContext)

This command checks whether inContext is the ID of one of the client's GLC context and returns GLC_TRUE if and only if it is.

Parameters
inContextThe context ID to be tested
Returns
GL_TRUE if inContext is the ID of a GLC context, GL_FALSE otherwise
See also
glcDeleteContext()
glcGenContext()
glcGetAllContexts()
glcContext()

◆ glcGetCurrentContext()

GLint glcGetCurrentContext ( void  )

Returns the value of the issuing thread's current GLC context ID variable.

Returns
The context ID of the current thread
See also
glcContext()
glcDeleteContext()
glcGenContext()
glcGetAllContexts()
glcIsContext()

◆ glcDeleteContext()

void glcDeleteContext ( GLint  inContext)

Marks for deletion the GLC context identified by inContext.

If the marked context is not current to any client thread, the command deletes the marked context immediatly. Otherwise, the marked context will be deleted during the execution of the next glcContext() command that causes it not to be current to any client thread.

Note
glcDeleteContext() does not destroy the GL objects associated with the context inContext. Indeed for performance reasons, GLC does not keep track of the GL context that contains the GL objects associated with the the GLC context that is destroyed. Even if GLC would keep track of the GL context, it could lead GLC to temporarily change the GL context, delete the GL objects, then restore the correct GL context. In order not to adversely impact the performance of most of programs, it is the responsability of the user to call glcDeleteGLObjects() on a GLC context that is intended to be destroyed.

The command raises GLC_PARAMETER_ERROR if inContext is not the ID of one of the client's GLC contexts.

Parameters
inContextThe ID of the context to be deleted
See also
glcGetAllContexts()
glcIsContext()
glcContext()
glcGetCurrentContext()

◆ glcContext()

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
inContextThe ID of the context to be made current
See also
glcGetCurrentContext()
glcDeleteContext()
glcGenContext()
glcGetAllContexts()
glcIsContext()

◆ glcGenContext()

GLint glcGenContext ( void  )

Generates a new GLC context and returns its ID.

Returns
The ID of the new context
See also
glcGetAllContexts()
glcIsContext()
glcContext()
glcGetCurrentContext()

◆ glcGetAllContexts()

GLint* glcGetAllContexts ( void  )

Returns a zero terminated array of GLC context IDs that contains one entry for each of the client's GLC contexts.

GLC uses the ISO C library command malloc to allocate the array. The client should use the ISO C library command free to deallocate the array when it is no longer needed.

Returns
The pointer to the array of context IDs.
See also
glcContext()
glcDeleteContext()
glcGenContext()
glcGetCurrentContext()
glcIsContext()

◆ glcGetError()

GLCenum glcGetError ( void  )

Retrieves the value of the issuing thread's GLC error code variable, assigns the value GLC_NONE to that variable, and returns the retrieved value.

Note
In contrast to the GL function glGetError, glcGetError only returns one error, not a list of errors.
Returns
An error code from the table below :

Error codes
Name Enumerant
GLC_NONE 0x0000
GLC_PARAMETER_ERROR 0x0040
GLC_RESOURCE_ERROR 0x0041
GLC_STATE_ERROR 0x0042

Generated for QuesoGLC by doxygen 1.9.1 written by Dimitri van Heesch © 1997-2005