Attaches a GLX context to one or more GLX drawables.
OpenGL C bindings library: libGL.a
Bool glXMakeContextCurrent(Display *dpy,
GLXDrawable draw,
GLXDrawable read,
GLXContext context)
The glXMakeContextCurrent subroutine does two things: (1) it makes the specified context parameter the current GLX rendering context of the calling thread, replacing the previously current context if one exists, and (2) it attaches context to the GLX drawables draw and read. As a result of these two actions, subsequent OpenGL rendering calls use context as a rendering context to modify the draw and read GLX drawables. Since the glXMakeContextCurrent subroutine always replaces the current rendering context with the specified context, there can be only one current context per thread.
draw is used for all OpenGL operations except:These frame buffer values are taken from read. Note that the same GLX Drawable may be specified for both draw and read.
Pending commands to the previous context, if any, are flushed before it is released.
The first time context is made current to any thread, its viewport is set to the full size of draw. Subsequent calls by any thread to the glXMakeContextCurrent subroutine using context have no effect on its viewport.
To release the current context without assigning a new one, call the glXMakeContextCurrent subroutine with the draw, read and context parameters set to None, None and Null, respectively.
The glXMakeContextCurrent subroutine returns True if it is successful, False otherwise. If False is returned, the previously current rendering context and drawables (if any) remain unchanged.
True | Returned if the glXMakeContextCurrent subroutine is successful. |
False | Returned if the glXMakeContextCurrent subroutine is not successful. The previously current rendering context and drawable (if any) remain unchanged. |
A process is a single execution environment, implemented in a single address space, consisting of one or more threads.
A thread is one of a set of subprocesses that share a single address space, but maintain separate program counters, stack spaces, and other related global data. A thread is the only member of its subprocess group that is equivalent to a process.
BadAccess | context is current to another thread at the time that the glXMakeContextCurrent subroutine is called. |
BadAlloc | The server has delayed allocation of ancillary buffers until glXMakeContextCurrent is called, only to find that it has insufficient resources to complete the allocation. |
BadMatch | It is generated by a number of conditions:
|
GLXBadContext | The specified context is not a valid GLX context. |
GLXBadContextState | The rendering context current to the calling thread has an OpenGL renderer state of GL_FEEDBACK or GL_SELECT. |
GLXBadCurrentDrawable | Pending OpenGL commands exist for the previous context, and the previous draw or read is no longer valid. |
GLXBadDrawable | draw or read is not a valid GLX drawable. |
GLXBadWindow | The X window underlying either draw or read is no longer valid. |
/usr/include/GL/gl.h | Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. |
/usr/include/GL/glx.h | Contains C language constants, variable type definitions, and ANSI function prototypes for GLX. |
The glCopyPixels subroutine, glReadPixels subroutine, glXCreateNewContext subroutine, glXCreatePbuffer subroutine, glXCreatePixmap subroutine and glXCreateWindow subroutine.
OpenGL in the AIXwindows (GLX) Environment.