Tao.Platform.Windows SDK Documentation

Wgl.wglCopyContext Method 

The wglCopyContext function copies selected groups of rendering states from one OpenGL rendering context to another.

[Visual Basic]
Public Shared Function wglCopyContext( _
   ByVal source As IntPtr, _
   ByVal destination As IntPtr, _
   ByVal mask As Integer _
) As Boolean
[C#]
public static bool wglCopyContext(
   IntPtr source,
   IntPtr destination,
   int mask
);

Parameters

source

Specifies the source OpenGL rendering context whose state information is to be copied.

destination

Specifies the destination OpenGL rendering context to which state information is to be copied.

mask

Specifies which groups of the source rendering state are to be copied to destination. It contains the bitwise-OR of the same symbolic names that are passed to the glPushAttrib function. You can use GL_ALL_ATTRIB_BITS to copy all the rendering state information.

Return Value

If the function succeeds, the return value is true. If the function fails, the return value is false. To get extended error information, call GetLastWin32Error.

Remarks

Using the wglCopyContext function, you can synchronize the rendering state of two rendering contexts. You can only copy the rendering state between two rendering contexts within the same process. The rendering contexts must be from the same OpenGL implementation. For example, you can always copy a rendering state between two rendering contexts with identical pixel format in the same process.

You can copy the same state information available only with the glPushAttrib function. You cannot copy some state information, such as pixel pack/unpack state, render mode state, select state, and feedback state. When you call wglCopyContext, make sure that the destination rendering context, destination, is not current to any thread.

See Also

Wgl Class | Tao.Platform.Windows Namespace | glPushAttrib | wglCreateContext | wglCreateLayerContext | wglShareLists