OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MaliSDK::EGLRuntime Class Reference

Functions for managing EGL. More...

#include <EGLRuntime.h>

Public Types

enum  OpenGLESVersion { OPENGLES1, OPENGLES2, OPENGLES3 }
 An enum to define OpenGL ES versions. More...
 

Static Public Member Functions

static void setEGLSamples (EGLint requiredEGLSamples)
 Set the value of EGL_SAMPLES (AntiAliasing level) to be requested. More...
 
static void initializeEGL (OpenGLESVersion requestedAPIVersion)
 Setup EGL environment. More...
 
static void terminateEGL (void)
 Shuts down EGL. More...
 

Static Public Attributes

static EGLDisplay display
 The EGL display in use (a platform native window handle). More...
 
static EGLContext context
 The EGL context in use. More...
 
static EGLConfig config
 The selected EGL config which matches the required attributes. More...
 
static EGLSurface surface
 The EGL surface in use. More...
 

Static Private Member Functions

static EGLConfig findConfig (bool strictMatch)
 Search for an EGL config with the attributes set in configAttributes. More...
 

Static Private Attributes

static EGLint configAttributes []
 Used to specify the EGL attributes we require from a configuration. More...
 
static EGLint contextAttributes []
 Used to specify the EGL attributes we require from a context. More...
 
static EGLint windowAttributes []
 Used to specify the EGL attributes we require from a window surface. More...
 

Detailed Description

Functions for managing EGL.

EGL is the standard windowing environment on embeded devices and is required to use OpenGL ES.

Definition at line 43 of file EGLRuntime.h.

Member Enumeration Documentation

An enum to define OpenGL ES versions.

Enumerator
OPENGLES1 
OPENGLES2 
OPENGLES3 

Definition at line 93 of file EGLRuntime.h.

Member Function Documentation

EGLConfig MaliSDK::EGLRuntime::findConfig ( bool  strictMatch)
staticprivate

Search for an EGL config with the attributes set in configAttributes.

Parameters
[in]strictMatchIf true, will attempt to match exactly the attributes set in configAttributes. Otherwise, the first config found which meets 'at least' the required attributes (as determined by the EGL specification) will be returned.
Returns
An EGL config with the required attributes.

Definition at line 85 of file EGLRuntime.cpp.

void MaliSDK::EGLRuntime::initializeEGL ( OpenGLESVersion  requestedAPIVersion)
static

Setup EGL environment.

Finds a suitable window configuration and sets up the required context. Different configurations are requested depending on the platform.

Parameters
[in]requestedAPIVersionThe API version required (OpenGL ES 1.x or OpenGLES 2.0).

Definition at line 223 of file EGLRuntime.cpp.

void MaliSDK::EGLRuntime::setEGLSamples ( EGLint  requiredEGLSamples)
static

Set the value of EGL_SAMPLES (AntiAliasing level) to be requested.

Used when initializeEGL() is called to select a config with requiredEGLSamples level of AntiAliasing.

Parameters
[in]requiredEGLSamplesThe Level of AntiAliasing required.
Note
It is not guaranteed that a config with the required level of AnitAliasing will be found. If it is not possible to find a matching config with the requested level, EGL_SAMPLES will be set to zero and the search for a config will start again.

Definition at line 319 of file EGLRuntime.cpp.

void MaliSDK::EGLRuntime::terminateEGL ( void  )
static

Shuts down EGL.

Definition at line 324 of file EGLRuntime.cpp.

Member Data Documentation

EGLConfig MaliSDK::EGLRuntime::config
static

The selected EGL config which matches the required attributes.

Definition at line 113 of file EGLRuntime.h.

EGLint MaliSDK::EGLRuntime::configAttributes
staticprivate
Initial value:
=
{
EGL_SAMPLES, 4,
EGL_ALPHA_SIZE, 0,
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_BUFFER_SIZE, 32,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, 0,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT ,
EGL_DEPTH_SIZE, 16,
EGL_NONE
}

Used to specify the EGL attributes we require from a configuration.

Passed to eglChooseConfig() in order to find a matching configuration.

Definition at line 60 of file EGLRuntime.h.

EGLContext MaliSDK::EGLRuntime::context
static

The EGL context in use.

Created by initializeEGL() using the selected config and the API version requested (OpenGL ES 1.x or OpenGL ES 2.0).

Definition at line 108 of file EGLRuntime.h.

EGLint MaliSDK::EGLRuntime::contextAttributes
staticprivate
Initial value:
=
{
EGL_CONTEXT_CLIENT_VERSION, 0,
EGL_NONE
}

Used to specify the EGL attributes we require from a context.

Passed to eglCreateContext() in order to get the correct context type.

Definition at line 67 of file EGLRuntime.h.

EGLDisplay MaliSDK::EGLRuntime::display
static

The EGL display in use (a platform native window handle).

Initialized by initializeEGL().

Definition at line 100 of file EGLRuntime.h.

EGLSurface MaliSDK::EGLRuntime::surface
static

The EGL surface in use.

Initialized by initializeEGL(). This surface is of window type and is used for rendering to the native window.

Definition at line 121 of file EGLRuntime.h.

EGLint MaliSDK::EGLRuntime::windowAttributes
staticprivate
Initial value:
=
{
EGL_NONE
}

Used to specify the EGL attributes we require from a window surface.

Passed to eglCreateWindowSurface() to get the required window surface type.

Using the defaults (EGL_RENDER_BUFFER = EGL_BACK_BUFFER).

Definition at line 74 of file EGLRuntime.h.


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