4.2.2. OpenGL ES emulator integration

This section describes:

Libraries

The OpenGL ES emulator contains two libraries corresponding to the separate OpenGL ES 2.0 and EGL 1.4 APIs.

Note

The Mac OS X version of the emulation does not support OpenGL ES 1.1 applications.

Table 4.1 shows the libraries for OpenGL ES 2.0 emulation:

Table 4.1. OpenGL ES emulator library structure

FilenameDescription
/usr/local/bin/libGLESv2.dylibSymlink to library for OpenGL ES 2.0 emulator
/usr/local/bin/libEGL.dylibSymlink to library for EGL API

EGL configuration

The EGL library supplied with the OpenGL ES Emulator supports OpenGL ES 2.0.

Note

Ensure that, in the OpenGL ES 2.0 application, the attribute list passed as a parameter to eglChooseConfig() includes the attribute EGL_RENDERABLE_TYPE set to the value EGL_OPENGL_ES2_BIT.

Example 4.1 shows a coded section:

Example 4.1. 

EGLDisplay Display;

EGLint Attributes[] = {
    EGL_RENDERABLE_TYPE, 
    EGL_OPENGL_ES2_BIT,  // use EGL_OPENGL_ES2_BIT 
                         // to return only 2.0 configs
    EGL_RED_SIZE, 8,
    EGL_GREEN_SIZE, 8,
    EGL_BLUE_SIZE, 8,
    EGL_NONE
};

EGLConfig Configs[1];
EGLint NumConfigs;
…
eglChooseConfig(Display, Attributes, Configs, 1, &NumConfigs);

EGL context creation

The EGL library supplied with the OpenGL ES emulator supports OpenGL ES 2.0 contexts.

Ensure that, in the OpenGL ES 2.0 application, the attribute list passed as a parameter to eglCreateContext() includes the attribute EGL_CONTEXT_CLIENT_VERSION set to the value 2.

Example 4.2 shows a coded section:

Example 4.2. 

EGLDisplay Display;

EGLConfig Configs[1];

EGLint ContextAttributes[] = {
	EGL_CONTEXT_CLIENT_VERSION, 2, // selects OpenGL ES 2.0
	EGL_NONE
};
…
Context = eglCreateContext(Display, Configs[0], EGL_NO_CONTEXT,                            ContextAttributes);

Copyright © 2009-2012 ARM. All rights reserved.ARM DUI 0511F
Non-ConfidentialID052512