Drawing3d documented Class Library

FeaturesW32.wglShareLists Method

The wglShareLists function enables multiple OpenGL rendering contexts to share a single display-list space.

[Visual Basic]
<PreserveSig> _
<DllImport(EntryPoint:="wglShareLists", CharSet:=CharSet.None, SetLastError:=True, ExactSpelling:=False, PreserveSig:=True, CallingConvention:=CallingConvention.Winapi, BestFitMapping:=False, ThrowOnUnmappableChar:=False, Value:="opengl32.dll")> _
<SuppressUnmanagedCodeSecurity> _
Public Shared Sub wglShareLists( _
   ByVal source As IntPtr, _
   ByVal destination As IntPtr _
[DllImport(EntryPoint="wglShareLists", CharSet=CharSet.None, SetLastError=True, ExactSpelling=False, PreserveSig=True, CallingConvention=CallingConvention.Winapi, BestFitMapping=False, ThrowOnUnmappableChar=False, Value="opengl32.dll")]
public static bool wglShareLists(
   IntPtr source,
   IntPtr destination



Specifies the OpenGL rendering context with which to share display lists.


Specifies the OpenGL rendering context to share display lists with source. The destination parameter should not contain any existing display lists when wglShareLists is called.

Return Value

When the function succeeds, the return value is true.

When the function fails, the return value is false and the display lists are not shared. To get extended error information, call GetLastWin32Error.


When you create an OpenGL rendering context, it has its own display-list space. The wglShareLists function enables a rendering context to share the display-list space of another rendering context; any number of rendering contexts can share a single display-list space. Once a rendering context shares a display-list space, the rendering context always uses the display-list space until the rendering context is deleted. When the last rendering context of a shared display-list space is deleted, the shared display-list space is deleted. All the indexes and definitions of display lists in a shared display-list space are shared.

You can only share display lists with rendering contexts within the same process. However, not all rendering contexts in a process can share display lists. Rendering contexts can share display lists only if they use the same implementation of OpenGL functions. All client rendering contexts of a given pixel format can always share display lists.

All rendering contexts of a shared display list must use an identical pixel format. Otherwise the results depend on the implementation of OpenGL used.


The wglShareLists function is only available with OpenGL version 1.01 or later. To determine the version number of the implementation of OpenGL, call glGetString.

See Also

FeaturesW32 Class | Drawing3d.OS.Windows Namespace | glGetString