GLXCREATENEWCONTEXT(3gl)GLXCREATENEWCONTEXT(3gl)NAME
glXCreateNewContext - create a new GLX rendering context
C SPECIFICATION
GLXContext glXCreateNewContext( Display *dpy,
GLXFBConfig config,
int render_type,
GLXContext shareList,
Bool direct )
PARAMETERS
dpy Specifies the connection to the X server.
config Specifies the config that defines the frame buffer resources
available to the rendering context.
render_type
Specifies the rendering type of the context. Allowed values
are GLX_RGBA_TYPE or GLX_COLOR_INDEX_TYPE.
shareList Specifies the context with which to share display lists.
NULL indicates that no sharing is to take place.
direct Specifies whether rendering is to be done with a direct con‐
nection to the graphics system if possible (True) or through
the X server (False).
DESCRIPTION
glXCreateNewContext is identical to glXCreateContext except that the
resulting GLXContext can be used to render to any "compatible" GLX‐
Drawable. A GLXContext and a GLXDrawable are compatible if:
a. the render_type attribute for the context is supported by the
GLXFBConfig that the drawable was created with. (e.g., if the
context was created with render_type GLX_RGBA_TYPE, then the
GLXFBConfig's GLX_RENDER_TYPE attribute must have the
GLX_RGBA_BIT bit set.)
b. all color buffers and ancillary buffers that exist in both GLXF‐
BConfigs have the same depth. For example, a GLXDrawable that
had a front left buffer and a back left buffer with red, green
and blue sizes of 4 would not be compatible with a GLXFBConfig
that had only a front left buffer with red, green and blue
sizes of 8. However, it would be compatible with a GLXFBConfig
that had only a front left buffer if the red, green and blue
sizes were 4.
No error will be generated if the value of GL_DRAW_BUFFER in ctx indi‐
cates a color buffer that is not supported by drawable. In this case,
all rendering will behave as if GL_DRAW_BUFFER was set to NONE. The
same is true for GL_READ_BUFFER: no error will be generated if it does
not correspond to a valid color buffer; subsequent glReadPixel and
glCopyPixel operations will simply return invalid data.
Note that it is an error to later call glDrawBuffer and/or glReadBuffer
(even if they are implicitly called via glPopAttrib) and specify a
color buffer that is not supported by drawable. Also subsequent calls
to glCopyPixels, that specify an unsupported ancillary buffer, will
result in an error.
NOTES
glXCreateNewContext is part of the GLX Version 1.3 command set. The
function is only valid if the connection supports GLX Version 1.3 or
later.
ERRORS
GLXBadContext is generated if sharelist is neither zero nor a valid GLX
rendering context.
GLXBadFBConfig is generated if config is not a valid GLXFBConfig.
BadMatch is generated if the context to be created would not share the
address space or the screen of the context specified by shareList.
BadAlloc is generated if the server does not have enough resources to
allocate the new context.
BadValue if render_type does not refer to a valid rendering type.
NULL is returned if execution fails on the client side.
SEE ALSO
glXMakeCurrent, glXMakeContextCurrent, glDrawBuffer, glReadBuffer,
glCopyPixels, glReadPixels, glPopAttrib, glXCreateContext, glXGetCon‐
figFromVisual, glXCreateWindow, glXCreatePixmap, glXCreatePbuffer, glX‐
ChooseFBConfig, glXGetFBConfigAttrib
18 May 01 GLXCREATENEWCONTEXT(3gl)