Kanzi 4.0.0-beta2
kanzi::EGLWindowSurface Class Reference

Class representing EGL window surface. More...

#include <kanzi/platform/platform/context/egl/egl_window_surface.hpp>

Public Member Functions

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

Static Public Member Functions

static KZ_NO_DISCARD EGLWindowSurface create (const EGLDisplay &eglDisplay, const EGLConfig &eglConfig, EGLNativeWindowType eglNativeWindow, span< EGLint > surfaceAttributes) noexcept
 Creates an EGL window surface.
 
static KZ_NO_DISCARD EGLWindowSurface create (const EGLDisplay &eglDisplay, const EGLConfig &eglConfig, EGLNativeWindowType eglNativeWindow, SurfaceColorSpace surfaceColorSpace) noexcept
 Creates an EGL window surface.
 
static KZ_NO_DISCARD ::EGLSurface getNoSurface () noexcept
 Gets a no surface EGL surface handle.
 

Detailed Description

Class representing EGL window surface.

Since
Kanzi 4.0.0 removed one constructor.

Constructor & Destructor Documentation

◆ EGLWindowSurface() [1/2]

kanzi::EGLWindowSurface::EGLWindowSurface ( const EGLDisplay & eglDisplay,
const EGLConfig & eglConfig,
EGLNativeWindowType eglNativeWindow,
span< EGLint > surfaceAttributes )
explicit

Constructor.

If construction succeeds, isNoSurface() returns false for this object. If construction fails, isNoSurface() returns true for this object, and egl::getError() returns the failure cause.

Parameters
eglDisplayEGL display connection.
eglConfigEGL configuration to use.
eglNativeWindowWindow to attach this surface to.
surfaceAttributesSpan of extra attributes. If the span is not empty, last element must be EGL_NONE.
Since
Kanzi 4.0.0

◆ 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 a no surface EGL surface handle.

Returns
EGL surface handle with a value representing no surface.

◆ create() [1/2]

static KZ_NO_DISCARD EGLWindowSurface kanzi::EGLWindowSurface::create ( const EGLDisplay & eglDisplay,
const EGLConfig & eglConfig,
EGLNativeWindowType eglNativeWindow,
span< EGLint > surfaceAttributes )
staticnoexcept

Creates an EGL window surface.

Logs the used surface attributes.

Parameters
eglDisplayEGL display connection.
eglConfigEGL configuration to use.
eglNativeWindowWindow to attach this surface to.
surfaceAttributesSpan of extra attributes. If the span is not empty, last element must be EGL_NONE.
Returns
The newly created EGL window surface.
Postcondition
isNoSurface() returns false for the returned object.
egl::getError() returns EGL_SUCCESS.
Since
Kanzi 4.0.0
  • Renamed from tryCreate.
  • No longer returns optional<>.
  • Removed const from span element declaration.

◆ create() [2/2]

static KZ_NO_DISCARD EGLWindowSurface kanzi::EGLWindowSurface::create ( const EGLDisplay & eglDisplay,
const EGLConfig & eglConfig,
EGLNativeWindowType eglNativeWindow,
SurfaceColorSpace surfaceColorSpace )
staticnoexcept

Creates an EGL window surface.

Logs the used surface attributes.

Parameters
eglDisplayEGL display connection.
eglConfigEGL configuration to use.
eglNativeWindowWindow to attach this surface to.
surfaceColorSpaceColor space to use for the surface.
Returns
The newly created EGL window surface.
Postcondition
isNoSurface() returns false for the returned object.
egl::getError() returns EGL_SUCCESS.
Since
Kanzi 4.0.0

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