3.2.2. OpenGL ES 2.0 Emulator integration

This section describes:

Libraries

The OpenGL ES 2.0 Emulator contains two libraries corresponding to the separate OpenGL ES 2.0 and EGL 1.3 APIs.

Table 3.2 shows the OpenGL ES 2.0 emulation library structure

Table 3.2. OpenGL ES 2.0 Emulator library structure

FilenameDescription
bin\libGLESv2.soLibrary for OpenGL ES 2.0 API
bin\libEGL.soLibrary for EGL API

EGL configuration

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

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 3.1 shows a coded section:

Example 3.1. 

EGLDisplay Display;

EGLint Attributes[] = {
    EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
    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 2.0 Emulator only 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 3.2 shows a coded section:

Example 3.2. 

EGLDisplay Display;

EGLConfig Configs[1];

EGLint ContextAttributes[] = {	EGL_CONTEXT_CLIENT_VERSION, 2,	EGL_NONE

};


Context = eglCreateContext(Display, Configs[0], EGL_NO_CONTEXT,                            ContextAttributes);

Shader language version

The OpenGL ES 2.0 Emulator checks whether the graphics card has version 1.2 of the OpenGL 2.0 Shader Language (GLSL) available:

  • If version 1.2 is available, this is selected by the pragma #version 120 in the conversion of the ESSL shader to GLSL.

  • If version 1.2 is not available, pragma #version 110 selects GLSL version 1.1, that limits some features.

Copyright © 2009-2010 ARM. All rights reserved.ARM DUI 0511C
Non-ConfidentialID072410