NAME

glXCopyContext - copy state from one rendering context to another

C SPECIFICATION

void ggllXXCCooppyyCCoonntteexxtt( Display _*_d_p_y,
                     GLXContext _s_r_c,
                     GLXContext _d_s_t,
                     unsigned long _m_a_s_k )

delim $$

PARAMETERS

_d_p_y
Specifies the connection to the X server.
_s_r_c
Specifies the source context.
_d_s_t
Specifies the destination context.
_m_a_s_k
Specifies which portions of _s_r_c state are to be copied to _d_s_t.

DESCRIPTION

ggllXXCCooppyyCCoonntteexxtt copies selected groups of state variables from _s_r_c to _d_s_t. _m_a_s_k indicates which groups of state variables are to be copied. _m_a_s_k contains the bitwise OR of the same symbolic names that are passed to the GL command ggllPPuusshhAAttttrriibb. The single symbolic constant GGLL__AALLLL__AATTTTRRIIBB__BBIITTSS can be used to copy the maximum possible portion of rendering state.

The copy can be done only if the renderers named by _s_r_c and _d_s_t share an address space. Two rendering contexts share an address space if both are nondirect using the same server, or if both are direct and owned by a single process. Note that in the nondirect case it is not necessary for the calling threads to share an address space, only for their related rendering contexts to share an address space.

Not all values for GL state can be copied. For example, pixel pack and unpack state, render mode state, and select and feedback state are not copied. The state that can be copied is exactly the state that is manipulated by the GL command
ggllPPuusshhAAttttrriibb.

An implicit ggllFFlluusshh is done by ggllXXCCooppyyCCoonntteexxtt if _s_r_c is the current context for the calling thread.

NOTES

A _p_r_o_c_e_s_s is a single execution environment, implemented in a single address space, consisting of one or more threads.

A _t_h_r_e_a_d 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 _t_h_r_e_a_d that is the only member of its subprocess group is equivalent to a _p_r_o_c_e_s_s.

ERRORS

BBaaddMMaattcchh is generated if rendering contexts _s_r_c and _d_s_t do not share an address space or were not created with respect to the same screen.

BBaaddAAcccceessss is generated if _d_s_t is current to any thread (including the calling thread) at the time ggllXXCCooppyyCCoonntteexxtt is called.

GGLLXXBBaaddCCuurrrreennttWWiinnddooww is generated if _s_r_c is the current context and the current drawable is a window that is no longer valid.

GGLLXXBBaaddCCoonntteexxtt is generated if either _s_r_c or _d_s_t is not a valid GLX context.

SEE ALSO

ggllPPuusshhAAttttrriibb, ggllXXCCrreeaatteeCCoonntteexxtt, ggllXXIIssDDiirreecctt