Kanzi  3.9.6
Kanzi Engine API
kanzi::EGLWindowSurface Class Reference

Class representing EGL window surface. More...

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

Public Member Functions

bool destroy (const EGLDisplay &eglDisplay)
 Destroys EGL window surface. More...
 
 EGLWindowSurface (const EGLDisplay &eglDisplay, const EGLConfig &eglConfig, EGLNativeWindowType eglNativeWindow)
 Constructor. More...
 
 EGLWindowSurface (::EGLSurface eglSurface)
 Constructor. More...
 
KZ_NO_DISCARD::EGLSurface getNativeHandle () const noexcept
 Gets EGL window surface handle. More...
 
bool swapBuffers (const EGLDisplay &eglDisplay) const
 Posts rendering results. More...
 

Static Public Member Functions

static KZ_NO_DISCARD ::EGLSurface getNoSurface () noexcept
 Gets an no surface EGL surface handle. More...
 
static KZ_NO_DISCARD optional< EGLWindowSurfacetryCreate (const EGLDisplay &eglDisplay, const EGLConfig &eglConfig, EGLNativeWindowType eglNativeWindow, const EGLint *surfaceAttributes) noexcept
 Creates an EGL window surface. More...
 

Detailed Description

Class representing EGL window surface.

Constructor & Destructor Documentation

◆ EGLWindowSurface() [1/2]

kanzi::EGLWindowSurface::EGLWindowSurface ( const EGLDisplay eglDisplay,
const EGLConfig eglConfig,
EGLNativeWindowType  eglNativeWindow 
)
explicit

Constructor.

Parameters
eglDisplayEGL display connection.
eglConfigEGL configuration to use.
eglNativeWindowWindow to attach this surface to.
Postcondition
isNoSurface() returns false for this object.
egl::getError() returns EGL_SUCCESS.

◆ EGLWindowSurface() [2/2]

kanzi::EGLWindowSurface::EGLWindowSurface ( ::EGLSurface  eglSurface)
explicit

Constructor.

Parameters
eglSurfaceEGL window surface handle.
Postcondition
egl::getError() returns EGL_SUCCESS.

Member Function Documentation

◆ getNoSurface()

static KZ_NO_DISCARD ::EGLSurface kanzi::EGLWindowSurface::getNoSurface ( )
staticnoexcept

Gets an no surface EGL surface handle.

Returns
EGL surface handle with a value representing no surface.

◆ tryCreate()

static KZ_NO_DISCARD optional<EGLWindowSurface> kanzi::EGLWindowSurface::tryCreate ( const EGLDisplay eglDisplay,
const EGLConfig eglConfig,
EGLNativeWindowType  eglNativeWindow,
const EGLint *  surfaceAttributes 
)
staticnoexcept

Creates an EGL window surface.

Parameters
eglDisplayEGL display connection.
eglConfigEGL configuration to use.
eglNativeWindowWindow to attach this surface to.
surfaceAttributesArray of extra attributes.
Return values
nulloptSurface creation failed.
Returns
The newly created EGL window surface.

◆ destroy()

bool kanzi::EGLWindowSurface::destroy ( const EGLDisplay eglDisplay)

Destroys EGL window surface.

Call this before destructing the object.

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

◆ swapBuffers()

bool kanzi::EGLWindowSurface::swapBuffers ( const EGLDisplay eglDisplay) const

Posts rendering results.

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

Parameters
eglDisplayEGL display connection.
See also
swapInterval().
Returns
True on success, false on failure.
Postcondition
egl::getError() returns EGL_SUCCESS.

◆ getNativeHandle()

KZ_NO_DISCARD::EGLSurface kanzi::EGLWindowSurface::getNativeHandle ( ) const
noexcept

Gets EGL window surface handle.

Returns
EGL window surface handle.

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