2.2.2. OpenGL ES 2.0 Emulator integration

This section describes:

DLLs and libraries

The OpenGL ES 2.0 Emulator Library consists of two DLLs, corresponding to the separate OpenGL ES 2.0 and EGL 1.3 APIs. For each of these DLLs, there is a corresponding import library for an OpenGL ES 2.0 application to statically link against. Applications must include both of the import libraries in builds to link against the OpenGL ES 2.0 and EGL 1.3 APIs. The DLLs use the __stdcall calling convention.

Table 2.2 shows the OpenGL ES 2.0 Emulator library structure

Table 2.2. OpenGL ES 2.0 Emulator library structure

FilenameDescription
bin\libGLESv2.dllDLL for OpenGL ES 2.0 Emulator
bin\libEGL.dllDLL for EGL implementation
lib\libGLESv2.libImport library for libGLESv2.dll
lib\libEGL.libImport library for libEGL.dll

Note

The OpenGL ES 2.0 Emulator can operate in normal or instrumented mode:

  • In the normal mode of operation, the OpenGL ES 2.0 Emulator does not dump any performance counters.

  • In the instrumented mode of operation, the OpenGL ES 2.0 Emulator dumps performance counters that can be viewed by the Mali GPU Performance Analysis Tool.

See Chapter 4 Operational modes for more information.

EGL configuration

The EGL library supplied with the OpenGL ES 2.0 Emulator supports OpenGL ES 2.0 only. 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 2.1 shows a coded section.

Example 2.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 supports OpenGL ES 2.0 contexts only. It is important to 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 2.2 shows a coded section.

Example 2.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 syntax checking by the Mali GPU Offline Shader Compiler

The shading language for use with the OpenGL ES 2.0 API is OpenGL ES Shading Language (ESSL). See the OpenGL ES Shading Language Specification. The corresponding shading language for use with OpenGL 2.0 API is OpenGL Shading Language (GLSL).

The OpenGL ES 2.0 Emulator validates the shader source:

  1. If the Mali GPU Offline Shader Compiler is installed and is present in the PATH environment variable, the OpenGL ES 2.0 Emulator uses this compiler to check the shader syntax for the ESSL code.

  2. The OpenGL ES 2.0 Emulator modifies the validated ESSL code to make it compliant GLSL code.

  3. The generated GLSL code is passed to the GLSL compiler in the OpenGL graphics driver of your Windows desktop machine.

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 using pragma #version 120 in the conversion of the ESSL shader to GLSL code.

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

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