Kanzi  3.9.5
Kanzi Engine API
kanzi::EGLDisplay Class Reference

Class representing an EGL display connection. More...

#include <kanzi/core.ui/platform/context_api/egl/egl_display.hpp>

Public Member Functions

::EGLConfig chooseConfig (int graphicsFormatID) const
 Gets EGL config handle from a graphics format ID. More...
 
::EGLConfig chooseConfig (span< const EGLint > attribs) const
 Gets EGL config handle using eglChooseConfig and attribute list. More...
 
EGLImage createImage (const EGLContext &eglContext, EGLenum target, void *data, const EGLint *attributes) noexcept
 Creates a new EGL image. More...
 
bool destroyImage (EGLImage image) noexcept
 Destroys an EGL image. More...
 
 EGLDisplay ()
 Default constructor, creates a no display. More...
 
 EGLDisplay (::EGLDisplay eglDisplay)
 Constructor. More...
 
KZ_NO_DISCARD bool getConfigAttributeValue (::EGLConfig eglConfig, EGLint attribute, EGLint &attributeValue) const noexcept
 Gets the value of an EGL config attribute. More...
 
KZ_NO_DISCARD EGLint getConfigCount () const noexcept
 Gets the number of EGL configs available. More...
 
KZ_NO_DISCARD std::vector<::EGLConfiggetConfigs () const noexcept
 Gets all EGL configs. More...
 
KZ_NO_DISCARD ::EGLDisplay getNativeHandle () const noexcept
 Gets EGL display handle. More...
 
EGLVersion initialize ()
 Opens the EGL display connection. More...
 
bool makeCurrent (const ::EGLSurface eglDrawSurface, const ::EGLSurface eglReadSurface, const ::EGLContext eglContext) const noexcept
 Binds surfaces to a context and the current thread. More...
 
bool swapInterval (int interval)
 Sets minimum number of displayed video frames before a buffer swap. More...
 
bool terminate ()
 Closes the EGL display connection. More...
 

Static Public Member Functions

static KZ_NO_DISCARD ::EGLNativeDisplayType getDefaultDisplay () noexcept
 Gets default native display handle. More...
 
static KZ_NO_DISCARD ::EGLDisplay getDisplay (::EGLNativeDisplayType nativeDisplay) noexcept
 Gets EGL display handle from native display handle. More...
 
static KZ_NO_DISCARD ::EGLDisplay getNoDisplay () noexcept
 Gets an no display EGL handle. More...
 

Detailed Description

Class representing an EGL display connection.

A display connection may either be open or closed.

Constructor & Destructor Documentation

◆ EGLDisplay() [1/2]

kanzi::EGLDisplay::EGLDisplay ( )
explicit

Default constructor, creates a no display.

Postcondition
egl::getError() returns EGL_SUCCESS.

◆ EGLDisplay() [2/2]

kanzi::EGLDisplay::EGLDisplay ( ::EGLDisplay  eglDisplay)
explicit

Constructor.

Parameters
eglDisplayEGL display handle.
Postcondition
egl::getError() returns EGL_SUCCESS.

Member Function Documentation

◆ getDefaultDisplay()

static KZ_NO_DISCARD ::EGLNativeDisplayType kanzi::EGLDisplay::getDefaultDisplay ( )
staticnoexcept

Gets default native display handle.

Returns
Default native display handle.

◆ getDisplay()

static KZ_NO_DISCARD ::EGLDisplay kanzi::EGLDisplay::getDisplay ( ::EGLNativeDisplayType  nativeDisplay)
staticnoexcept

Gets EGL display handle from native display handle.

Returns
Display handle.

◆ getNoDisplay()

static KZ_NO_DISCARD ::EGLDisplay kanzi::EGLDisplay::getNoDisplay ( )
staticnoexcept

Gets an no display EGL handle.

Returns
EGL display handle with a value representing no display.

◆ initialize()

EGLVersion kanzi::EGLDisplay::initialize ( )

Opens the EGL display connection.

This should be the first function called on a new display object. Use terminate() to close the open connection before destructing the object.

Returns
EGL version information.

◆ terminate()

bool kanzi::EGLDisplay::terminate ( )

Closes the EGL display connection.

Returns
True on success, false on failure.

◆ makeCurrent()

bool kanzi::EGLDisplay::makeCurrent ( const ::EGLSurface  eglDrawSurface,
const ::EGLSurface  eglReadSurface,
const ::EGLContext  eglContext 
) const
noexcept

Binds surfaces to a context and the current thread.

Parameters
eglDrawSurfaceSurface bound as draw destination.
eglReadSurfaceSurface bound as read source.
eglContextContext to bind to.
Returns
True on success, false on failure.

◆ swapInterval()

bool kanzi::EGLDisplay::swapInterval ( int  interval)

Sets minimum number of displayed video frames before a buffer swap.

Parameters
intervalMinimum number of video frames to wait before buffer swap.
Returns
True on success, false on failure.

◆ createImage()

EGLImage kanzi::EGLDisplay::createImage ( const EGLContext eglContext,
EGLenum  target,
void *  data,
const EGLint *  attributes 
)
noexcept

Creates a new EGL image.

Use destroyImage() to destroy the created image.

Parameters
eglContextContext for which the image is created.
targetThe image source type.
dataThe image source.
attributesThe image attributes
Returns
A new EGL image. The value is a no image on failure.

◆ destroyImage()

bool kanzi::EGLDisplay::destroyImage ( EGLImage  image)
noexcept

Destroys an EGL image.

Parameters
imageEGL image to destroy.
Returns
True on success, false on failure.

◆ chooseConfig() [1/2]

::EGLConfig kanzi::EGLDisplay::chooseConfig ( int  graphicsFormatID) const

Gets EGL config handle from a graphics format ID.

Parameters
graphicsFormatIDGraphics format ID to use.
Returns
EGL config handle corresponding to the graphics format ID. The value is a no config if there was no match.

◆ chooseConfig() [2/2]

::EGLConfig kanzi::EGLDisplay::chooseConfig ( span< const EGLint >  attribs) const

Gets EGL config handle using eglChooseConfig and attribute list.

Parameters
attribsList of EGL attributes used to choose the config. The list must be terminated with EGL_NONE.
Returns
EGL config handle returned by kzsEGLChooseConfig. The value is a no config if there was no match.

◆ getConfigCount()

KZ_NO_DISCARD EGLint kanzi::EGLDisplay::getConfigCount ( ) const
noexcept

Gets the number of EGL configs available.

Returns
The number of EGL configs available.

◆ getConfigs()

KZ_NO_DISCARD std::vector<::EGLConfig> kanzi::EGLDisplay::getConfigs ( ) const
noexcept

Gets all EGL configs.

Returns
A vector of EGL config handles.

◆ getConfigAttributeValue()

KZ_NO_DISCARD bool kanzi::EGLDisplay::getConfigAttributeValue ( ::EGLConfig  eglConfig,
EGLint  attribute,
EGLint &  attributeValue 
) const
noexcept

Gets the value of an EGL config attribute.

Parameters
eglConfigEGL config to query.
attributeThe attribute to query.
attributeValueStores the value of the attribute.
Returns
True on success, false on failure.

◆ getNativeHandle()

KZ_NO_DISCARD ::EGLDisplay kanzi::EGLDisplay::getNativeHandle ( ) const
noexcept

Gets EGL display handle.

Returns
EGL display handle.

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