Kanzi  3.9.9
Kanzi Engine C++ API
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. More...
 
int describePixelFormat (int formatID, PIXELFORMATDESCRIPTOR *formatDescriptor) const noexcept
 Describes the pixel format. More...
 
KZ_NO_DISCARD HDC getNativeHandle () const noexcept
 Gets the context handle of a device. More...
 
bool setPixelFormat (int formatID, const PIXELFORMATDESCRIPTOR *formatDescriptor) noexcept
 Sets the pixel format. More...
 
bool swapBuffers () noexcept
 Posts rendering results. More...
 
 Win32DeviceContext (HDC deviceContext)
 Constructor. More...
 

Detailed Description

Class that represents the Win32 device context.

Since
Kanzi 3.9.7

Constructor & Destructor Documentation

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

Constructor.

Parameters
deviceContextDevice context handle.

Member Function Documentation

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.
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.
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.
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.
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: