C SPECIFICATION

       Bool glXMakeContextCurrent( Display *dpy,
                                   GLXDrawable dra )
       Bool glXMakeContextCurrent( Display *,
                                   GLXDrawable GLXDrawable,
                                   GLXDrawable GLXDrawable,
                                   GLXContext GLXContext )



PARAMETERS

       Specifies the connection to the X server.

       GLXDrawable  Specifies a GLX drawable that to render into.  Must be  an
                    XID representing a GLXWindow, GLXPixmap, or GLXPbuffer.

       GLXDrawable  Specifies  a  GLX  drawable that to read from.  Must be an
                    XID representing a GLXWindow, GLXPixmap, or GLXPbuffer.

       GLXContext   Specifies the GLX context to be bound to  GLXDrawable  and
                    GLXContext.


DESCRIPTION

       glXMakeContextCurrent  binds GLXContext to the current rendering thread
       and to the GLXDrawable and GLXDrawable GLX drawables.  GLXDrawable  and
       GLXDrawable may be the same.

       GLXDrawable is used for all OpenGL operations except:

         Any  pixel  data  that are read based on the value of GL_READ_BUFFER.
         Note that accumulation operations use the  value  of  GL_READ_BUFFER,
         but are not allowed unless GLXDrawable is identical to GLXDrawable.

         Any  depth values that are retrieved by glReadPixels or glCopyPixels.

         Any  stencil  values  that   are   retrieved   by   glReadPixels   or
         glCopyPixels.

Frame buffer values are taken from GLXDrawable.

       If  the  current rendering thread has a current rendering context, that
       context is flushed and replaced by GLXContext.

       The first time that GLXContext is made current, the viewport and  scis-
       sor  dimensions  are  set to the size of the GLXDrawable drawable.  The
       viewport and scissor are not modified when GLXContext  is  subsequently
       made current.

       To  release  the  current  context  without  assigning  a new one, call
       glXMakeContextCurrent with GLXDrawable and GLXDrawable set to None  and
       GLXContext set to NULL.


ERRORS

       BadMatch is generated if GLXDrawable and GLXDrawable are  not  compati-
       ble.

       BadAccess is generated if GLXContext is current to some other thread.

       GLXContextState  is  generated  if there is a current rendering context
       and its render mode is either GL_FEEDBACK or GL_SELECT.

       GLXBadContext is generated if GLXContext is not a valid  GLX  rendering
       context.

       GLXBadDrawable  is  generated  if  GLXDrawable  or GLXDrawable is not a
       valid GLX drawable.

       GLXBadWindow is generated if the underlying X window  for  either  GLX-
       Drawable or GLXDrawable is no longer valid.

       GLXBadCurrentDrawable is generated if the previous context of the call-
       ing thread has unflushed commands, and  the  previous  drawable  is  no
       longer valid.

       BadAlloc is generated if the X server does not have enough resources to
       allocate the buffers.

       BadMatch is generated if:

         GLXDrawable and GLXDrawable  cannot  fit  into  frame  buffer  memory
         simultaneously.

         GLXDrawable  or GLXDrawable is a GLXPixmap and GLXContext is a direct
         rendering context.

         GLXDrawable or GLXDrawable is a GLXPixmap and GLXContext  was  previ-
         ously bound to a GLXWindow or GLXPbuffer.

         GLXDrawable  or  GLXDrawable is a GLXWindow or GLXPbuffer and GLXCon-
         text was previously bound to a GLXPixmap.


SEE ALSO

       glXCreateNewContext,         glXCreateWindow,          glXCreatePixmap,
       glXCreatePbuffer,        glXDestroyContext,       glXGetCurrentContext,
       glXGetCurrentDisplay, glXGetCurrentDrawable, glXGetCurrentReadDrawable,
       glXMakeCurrent



                                                     GLXMAKECONTEXTCURRENT(3G)

Man(1) output converted with man2html