Kanzi 3.9.10
kanzi::win32::Win32DeviceContext Class Reference

Class that represents the Win32 device context. More...

#include <kanzi/core.ui/platform/windowing_ng/win32/win32_device_context.hpp>

Public Member Functions

KZ_NO_DISCARD int choosePixelFormat (const PIXELFORMATDESCRIPTOR *formatDescriptor) noexcept
 Chooses the best pixel format to match the given pixel format description.
 
int describePixelFormat (int formatID, PIXELFORMATDESCRIPTOR *formatDescriptor) const noexcept
 Describes the pixel format.
 
KZ_NO_DISCARD HDC getNativeHandle () const noexcept
 Gets the context handle of a device.
 
bool setPixelFormat (int formatID, const PIXELFORMATDESCRIPTOR *formatDescriptor) noexcept
 Sets the pixel format.
 
bool swapBuffers () noexcept
 Posts rendering results.
 
 Win32DeviceContext (HDC deviceContext)
 Constructor.
 

Detailed Description

Class that represents the Win32 device context.

Since
Kanzi 3.9.7

Constructor & Destructor Documentation

◆ Win32DeviceContext()

kanzi::win32::Win32DeviceContext::Win32DeviceContext ( HDC deviceContext)
explicit

Constructor.

Parameters
deviceContextDevice context handle.

Member Function Documentation

◆ swapBuffers()

bool kanzi::win32::Win32DeviceContext::swapBuffers ( )
noexcept

Posts rendering results.

Implicitly flushes the rendering pipeline and executes all received rendering commands before posting.

See also
swapInterval().
Returns
On success, true, otherwise false.

◆ describePixelFormat()

int kanzi::win32::Win32DeviceContext::describePixelFormat ( int formatID,
PIXELFORMATDESCRIPTOR * formatDescriptor ) const
noexcept

Describes the pixel format.

Parameters
formatIDThe format ID for which to describe the pixel format.
formatDescriptorThe format descriptor output parameter to receive the pixel format description.
Returns
On success, maximum pixel format index, otherwise 0.

◆ setPixelFormat()

bool kanzi::win32::Win32DeviceContext::setPixelFormat ( int formatID,
const PIXELFORMATDESCRIPTOR * formatDescriptor )
noexcept

Sets the pixel format.

Parameters
formatIDThe pixel format ID to set.
formatDescriptorThe pixel format description to request.
Returns
On success, true, otherwise false.

◆ choosePixelFormat()

KZ_NO_DISCARD int kanzi::win32::Win32DeviceContext::choosePixelFormat ( const PIXELFORMATDESCRIPTOR * formatDescriptor)
noexcept

Chooses the best pixel format to match the given pixel format description.

Parameters
formatDescriptorThe pixel format description to request.
Returns
On success, closest pixel format index, otherwise 0.

◆ getNativeHandle()

KZ_NO_DISCARD HDC kanzi::win32::Win32DeviceContext::getNativeHandle ( ) const
noexcept

Gets the context handle of a device.

Returns
The context handle of a device.

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