Drawing3d documented Class Library

FeaturesW32.wglGetCurrentContext Method

The wglGetCurrentContext function obtains a handle to the current OpenGL rendering context of the calling thread.

[Visual Basic]
<PreserveSig> _
<DllImport(EntryPoint:="wglGetCurrentContext", CharSet:=CharSet.None, SetLastError:=False, ExactSpelling:=False, PreserveSig:=True, CallingConvention:=CallingConvention.Winapi, BestFitMapping:=False, ThrowOnUnmappableChar:=False, Value:="opengl32.dll")> _
<SuppressUnmanagedCodeSecurity> _
Public Shared Sub wglGetCurrentContext()
[C#]
[PreserveSig]
[DllImport(EntryPoint="wglGetCurrentContext", CharSet=CharSet.None, SetLastError=False, ExactSpelling=False, PreserveSig=True, CallingConvention=CallingConvention.Winapi, BestFitMapping=False, ThrowOnUnmappableChar=False, Value="opengl32.dll")]
[SuppressUnmanagedCodeSecurity]
public static IntPtr wglGetCurrentContext();

Return Value

If the calling thread has a current OpenGL rendering context, wglGetCurrentContext returns a handle to that rendering context. Otherwise, the return value is Zero.

Remarks

The current OpenGL rendering context of a thread is associated with a device context by means of the wglMakeCurrent function.

See Also

FeaturesW32 Class | Drawing3d.OS.Windows Namespace | wglCreateContext | wglDeleteContext | wglMakeCurrent