Ocean
Loading...
Searching...
No Matches
Ocean::Platform::GLES::EGLContext Class Reference

This class encapsulates an EGL context. More...

#include <EGLContext.h>

Public Types

typedef std::pair< EGLint, EGLint > ConfigAttributePair
 Definition of a configuration attribute pair combining attribute (first) and value (second).
 
typedef std::vector< ConfigAttributePairConfigAttributePairs
 Definition of a vector holding configuration pairs.
 

Public Member Functions

 EGLContext ()
 Creates a new uninitialized context object.
 
 EGLContext (EGLContext &&context)
 Move constructor.
 
 EGLContext (const EGLContext &context)=delete
 Disabled copy consturctor.
 
 ~EGLContext ()
 Destructs the context object and releases all remaining EGL resources.
 
EGLint majorVersion () const
 Returns the major version of this egl context.
 
EGLint minorVersion () const
 Returns the minor version of this egl context.
 
const EGLDisplay & display () const
 Returns the display id of this egl context.
 
const EGLConfig & config () const
 Returns the configuration of the egl context.
 
const ::EGLContextcontext () const
 Returns the context id of this egl context.
 
bool initialize (const ConfigAttributePairs &configAttributePairs=ConfigAttributePairs(), EGLContext *shareContext=nullptr)
 Initializes this context object.
 
void release ()
 Releases this context.
 
bool isValid () const
 Returns whether this context is valid (whether the context is initialized) and whether it can be used.
 
 operator bool () const
 Returns whether this context is valid (whether the context is initialized) and whether it can be used.
 
EGLContextoperator= (EGLContext &&context)
 Move operator.
 
EGLContextoperator= (const EGLContext &context)=delete
 Disabled copy operator.
 

Static Public Member Functions

static const char * translateError (const EGLint errorValue)
 Translates an EGL error to a string.
 

Protected Attributes

EGLint majorVersion_
 The major EGL version.
 
EGLint minorVersion_
 The minor EGL version.
 
EGLDisplay display_
 The EGL display.
 
EGLConfig config_
 The EGL config.
 
::EGLContext context_
 The EGL context.
 
EGLSurface dummySurface_
 The dummy surface.
 

Detailed Description

This class encapsulates an EGL context.

Member Typedef Documentation

◆ ConfigAttributePair

typedef std::pair<EGLint, EGLint> Ocean::Platform::GLES::EGLContext::ConfigAttributePair

Definition of a configuration attribute pair combining attribute (first) and value (second).

◆ ConfigAttributePairs

Definition of a vector holding configuration pairs.

Constructor & Destructor Documentation

◆ EGLContext() [1/3]

Ocean::Platform::GLES::EGLContext::EGLContext ( )

Creates a new uninitialized context object.

See also
initialize().

◆ EGLContext() [2/3]

Ocean::Platform::GLES::EGLContext::EGLContext ( EGLContext &&  context)

Move constructor.

Parameters
contextThe context to be moved

◆ EGLContext() [3/3]

Ocean::Platform::GLES::EGLContext::EGLContext ( const EGLContext context)
delete

Disabled copy consturctor.

Parameters
contextThe context which whould be copied

◆ ~EGLContext()

Ocean::Platform::GLES::EGLContext::~EGLContext ( )

Destructs the context object and releases all remaining EGL resources.

See also
release().

Member Function Documentation

◆ config()

const EGLConfig & Ocean::Platform::GLES::EGLContext::config ( ) const
inline

Returns the configuration of the egl context.

Returns
The context's configuration

◆ context()

const ::EGLContext & Ocean::Platform::GLES::EGLContext::context ( ) const
inline

Returns the context id of this egl context.

Returns
The context's context id

◆ display()

const EGLDisplay & Ocean::Platform::GLES::EGLContext::display ( ) const
inline

Returns the display id of this egl context.

Returns
The context's display id

◆ initialize()

bool Ocean::Platform::GLES::EGLContext::initialize ( const ConfigAttributePairs configAttributePairs = ConfigAttributePairs(),
EGLContext shareContext = nullptr 
)

Initializes this context object.

Parameters
configAttributePairsThe configuration attributes the resulting context must support.
shareContextOptional share context
See also
release().

◆ isValid()

bool Ocean::Platform::GLES::EGLContext::isValid ( ) const

Returns whether this context is valid (whether the context is initialized) and whether it can be used.

Returns
True, if so

◆ majorVersion()

EGLint Ocean::Platform::GLES::EGLContext::majorVersion ( ) const
inline

Returns the major version of this egl context.

Returns
The context's major version

◆ minorVersion()

EGLint Ocean::Platform::GLES::EGLContext::minorVersion ( ) const
inline

Returns the minor version of this egl context.

Returns
The context's minor version

◆ operator bool()

Ocean::Platform::GLES::EGLContext::operator bool ( ) const
inlineexplicit

Returns whether this context is valid (whether the context is initialized) and whether it can be used.

Returns
True, if so

◆ operator=() [1/2]

EGLContext & Ocean::Platform::GLES::EGLContext::operator= ( const EGLContext context)
delete

Disabled copy operator.

Parameters
contextThe context which would be copied

◆ operator=() [2/2]

EGLContext & Ocean::Platform::GLES::EGLContext::operator= ( EGLContext &&  context)

Move operator.

Parameters
contextThe context to be moved

◆ release()

void Ocean::Platform::GLES::EGLContext::release ( )

Releases this context.

See also
initialize().

◆ translateError()

static const char * Ocean::Platform::GLES::EGLContext::translateError ( const EGLint  errorValue)
static

Translates an EGL error to a string.

Parameters
errorValueThe error value to translate
Returns
The translated error value

Field Documentation

◆ config_

EGLConfig Ocean::Platform::GLES::EGLContext::config_
protected

The EGL config.

◆ context_

::EGLContext Ocean::Platform::GLES::EGLContext::context_
protected

The EGL context.

◆ display_

EGLDisplay Ocean::Platform::GLES::EGLContext::display_
protected

The EGL display.

◆ dummySurface_

EGLSurface Ocean::Platform::GLES::EGLContext::dummySurface_
protected

The dummy surface.

◆ majorVersion_

EGLint Ocean::Platform::GLES::EGLContext::majorVersion_
protected

The major EGL version.

◆ minorVersion_

EGLint Ocean::Platform::GLES::EGLContext::minorVersion_
protected

The minor EGL version.


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