Kanzi  3.9.8
Kanzi Engine C++ API
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. More...
 
bool makeCurrent (const Win32DeviceContext &deviceContext) noexcept
 Activates WGL context for the current thread. More...
 
bool makeCurrent (HDC deviceContextHandle) noexcept
 Activates the WGL context for the current thread. More...
 
bool releaseCurrent () noexcept
 Deactivates the WGL context for the current thread. More...
 
 WGLContext (Win32DeviceContext &deviceContext, int formatID)
 Constructor. More...
 
 WGLContext (HDC deviceContextHandle)
 Constructor. More...
 
 WGLContext (HGLRC renderContext)
 Constructor. More...
 
 WGLContext (Win32DeviceContext &deviceContext, HGLRC sharedContext, span< int > attribs)
 Constructor. More...
 

Static Public Member Functions

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

Detailed Description

Class that represents the WGL context.

Since
Kanzi 3.9.7

Constructor & Destructor Documentation

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.
kanzi::win32::WGLContext::WGLContext ( HDC  deviceContextHandle)
explicit

Constructor.

Parameters
deviceContextHandleThe native device context for which to create the WGL context.
kanzi::win32::WGLContext::WGLContext ( HGLRC  renderContext)
explicit

Constructor.

Parameters
renderContextWGL render context handle.
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

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.
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.
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.
bool kanzi::win32::WGLContext::releaseCurrent ( )
noexcept

Deactivates the WGL context for the current thread.

Returns
On success, true, otherwise false.
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: