Kanzi 3.9.10
kanzi::win32::WGLContext Class Reference

Class that represents the WGL context. More...

#include <kanzi/core.ui/platform/context_api/wgl/wgl_context.hpp>

Public Member Functions

KZ_NO_DISCARD HGLRC getNativeHandle () const noexcept
 Gets the WGL render context handle.
 
bool makeCurrent (const Win32DeviceContext &deviceContext) noexcept
 Activates WGL context for the current thread.
 
bool makeCurrent (HDC deviceContextHandle) noexcept
 Activates the WGL context for the current thread.
 
bool releaseCurrent () noexcept
 Deactivates the WGL context for the current thread.
 
 WGLContext (HDC deviceContextHandle)
 Constructor.
 
 WGLContext (HGLRC renderContext)
 Constructor.
 
 WGLContext (Win32DeviceContext &deviceContext, HGLRC sharedContext, span< int > attribs)
 Constructor.
 
 WGLContext (Win32DeviceContext &deviceContext, int formatID)
 Constructor.
 

Static Public Member Functions

static PROC getProcAddress (const char *functionName) noexcept
 Gets the pointer to a GL function.
 

Detailed Description

Class that represents the WGL context.

Since
Kanzi 3.9.7

Constructor & Destructor Documentation

◆ WGLContext() [1/4]

kanzi::win32::WGLContext::WGLContext ( Win32DeviceContext & deviceContext,
int formatID )
explicit

Constructor.

Parameters
deviceContextThe device context for which to create the WGL context.
formatIDThe graphics format ID with which to select the pixel format. To select the default pixel format, use 0.

◆ WGLContext() [2/4]

kanzi::win32::WGLContext::WGLContext ( HDC deviceContextHandle)
explicit

Constructor.

Parameters
deviceContextHandleThe native device context for which to create the WGL context.

◆ WGLContext() [3/4]

kanzi::win32::WGLContext::WGLContext ( HGLRC renderContext)
explicit

Constructor.

Parameters
renderContextWGL render context handle.

◆ WGLContext() [4/4]

kanzi::win32::WGLContext::WGLContext ( Win32DeviceContext & deviceContext,
HGLRC sharedContext,
span< int > attribs )
explicit

Constructor.

Parameters
deviceContextThe device context for which to create the WGL context.
sharedContextWGL render context handle to share data with.
attribsList of WGL attributes used for the WGL context. The list must be terminated with 0.

Member Function Documentation

◆ getProcAddress()

static PROC kanzi::win32::WGLContext::getProcAddress ( const char * functionName)
staticnoexcept

Gets the pointer to a GL function.

Parameters
functionNameName of the GL function for which to get the pointer.
Returns
Pointer to the function. If the function is not found, null.

◆ makeCurrent() [1/2]

bool kanzi::win32::WGLContext::makeCurrent ( const Win32DeviceContext & deviceContext)
noexcept

Activates WGL context for the current thread.

Parameters
deviceContextThe device context for which to activate the current thread.
Returns
On success, true, otherwise false.

◆ makeCurrent() [2/2]

bool kanzi::win32::WGLContext::makeCurrent ( HDC deviceContextHandle)
noexcept

Activates the WGL context for the current thread.

Parameters
deviceContextHandleThe native device context for which to activate the current thread.
Returns
On success, true, otherwise false.

◆ releaseCurrent()

bool kanzi::win32::WGLContext::releaseCurrent ( )
noexcept

Deactivates the WGL context for the current thread.

Returns
On success, true, otherwise false.

◆ getNativeHandle()

KZ_NO_DISCARD HGLRC kanzi::win32::WGLContext::getNativeHandle ( ) const
noexcept

Gets the WGL render context handle.

Returns
The WGL render context handle.

The documentation for this class was generated from the following file: