| |||
| Home > Installation and Configuration on Windows > Configuring the OpenGL ES 2.0 Emulator on Windows > OpenGL ES 2.0 Emulator integration | |||
This section describes:
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
| Filename | Description |
|---|---|
bin\libGLESv2.dll | DLL for OpenGL ES 2.0 Emulator |
bin\libEGL.dll | DLL for EGL implementation |
lib\libGLESv2.lib | Import library for libGLESv2.dll |
lib\libEGL.lib | Import library for libEGL.dll |
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.
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);
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);
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:
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.
The OpenGL ES 2.0 Emulator modifies the validated ESSL code to make it compliant GLSL code.
The generated GLSL code is passed to the GLSL compiler in the OpenGL graphics driver of your Windows desktop machine.
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.