Kanzi 4.1.0
kanzi::EGLContext Class Reference

Class representing an EGL context. More...

#include <kanzi/platform/platform/gl/context_api/egl_ng/egl_context.hpp>

Public Types

typedef void(* GLProcPointer) ()
 Pointer to GL function.
 

Public Member Functions

bool destroy (const EGLDisplay &eglDisplay)
 Destroys EGL context.
 
 EGLContext ()
 Default constructor, creates a no context.
 
 EGLContext (::EGLContext eglContext)
 Constructor.
 
 EGLContext (const EGLDisplay &eglDisplay, const EGLConfig &eglConfig, ::EGLContext sharedContext, span< const EGLint > attribs)
 Constructor.
 
KZ_NO_DISCARD::EGLContext getNativeHandle () const noexcept
 Gets EGL context handle.
 

Static Public Member Functions

static KZ_NO_DISCARD ::EGLContext getCurrentContext ()
 Gets context for current thread.
 
static KZ_NO_DISCARD ::EGLContext getNoContext () noexcept
 Gets an no context EGL handle.
 
static KZ_NO_DISCARD GLProcPointer getProcAddress (const char *functionName)
 Retrieves pointer to GL function.
 

Friends

bool operator!= (const EGLContext &lhs, const EGLContext &rhs) noexcept
 Inequality operator.
 
bool operator== (const EGLContext &lhs, const EGLContext &rhs) noexcept
 Equality operator.
 

Detailed Description

Class representing an EGL context.

Since
4.1.0 removed constructor to prevent creating EGLContext with supplied context version. Use constructor that accepts attributes instead.
4.1.0 removed constructor to prevent creating EGLContext with implicitly-defined context version. Use constructor that accepts attributes instead.
Attention
This feature is experimental and is likely to change in future releases.

Member Typedef Documentation

◆ GLProcPointer

typedef void(* kanzi::EGLContext::GLProcPointer) ()

Pointer to GL function.

Constructor & Destructor Documentation

◆ EGLContext() [1/3]

kanzi::EGLContext::EGLContext ( )
explicit

Default constructor, creates a no context.

Postcondition
egl::getError() returns EGL_SUCCESS.

◆ EGLContext() [2/3]

kanzi::EGLContext::EGLContext ( const EGLDisplay & eglDisplay,
const EGLConfig & eglConfig,
::EGLContext sharedContext,
span< const EGLint > attribs )
explicit

Constructor.

Parameters
eglDisplayEGL display connection.
eglConfigEGL configuration to use.
sharedContextEGL context to share data with.
attribsList of EGL attributes used to create the context. The list must be terminated with EGL_NONE.
Postcondition
egl::getError() returns EGL_SUCCESS.

◆ EGLContext() [3/3]

kanzi::EGLContext::EGLContext ( ::EGLContext eglContext)
explicit

Constructor.

Parameters
eglContextEGL context handle.
Postcondition
egl::getError() returns EGL_SUCCESS.

Member Function Documentation

◆ getProcAddress()

static KZ_NO_DISCARD GLProcPointer kanzi::EGLContext::getProcAddress ( const char * functionName)
static

Retrieves pointer to GL function.

Parameters
functionNameName of the function.
Returns
Pointer to the function, or null if not found.

◆ getCurrentContext()

static KZ_NO_DISCARD ::EGLContext kanzi::EGLContext::getCurrentContext ( )
static

Gets context for current thread.

Returns
EGL context handle of the current context, or a no context handle if no context is current.

◆ getNoContext()

static KZ_NO_DISCARD ::EGLContext kanzi::EGLContext::getNoContext ( )
staticnoexcept

Gets an no context EGL handle.

Returns
EGL context handle with a value representing no context.

◆ destroy()

bool kanzi::EGLContext::destroy ( const EGLDisplay & eglDisplay)

Destroys EGL context.

Call this before destructing the object.

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

◆ getNativeHandle()

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

Gets EGL context handle.

Returns
EGL context handle.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const EGLContext & lhs,
const EGLContext & rhs )
friend

Equality operator.

Parameters
lhsThe left operand.
rhsThe right operand.
Returns
If the left and right operand are equal, true, otherwise false.

◆ operator!=

bool operator!= ( const EGLContext & lhs,
const EGLContext & rhs )
friend

Inequality operator.

Parameters
lhsThe left operand.
rhsThe right operand.
Returns
If the left and right operand are not equal, true, otherwise false.

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