S60 3rd Edition SDK FP1 for Symbian OS
Example Applications Guide

OpenGL ES Simple Cube Example

1. About this Example
2. Prerequisites
3. Desing and Implemention


1. About this Example

This example demonstrates the use of vertex arrays, color arrays and shading modes in OpenGL ES by rotating a colored cube on the screen. The user can change the setup by accessing the menu by pressing the left software button.

This example can be extended to any kind of OpenGL ES application, but you might want to look at the other example applications as well for how to use other, different kinds of, OpenGL ES features.

Only classes used by this example are the basic UI framework baseclasses. Open GL ES itself is pure C method call API and doesn't use classes.


2. Prerequisites

To build and run this example you need to have the S60 SDK installed and working correctly on your computer. You also need basic understanding on how to build S60 applications.

To work with this example application you need basic understanding on how to build S60 applications and basic undestanding of how Symbian (or COE) UI and application framework works. Also basic knowledge on OpenGL or OpenGL ES is required if you wish to modify the example.


3. Desing and Implemention

After an instance of an example class is created, the AppInit() method is called, which finalizes the initialization of OpenGL ES. All the object geometry is given as vertices. If floating point coordinates are used, the computation slows down considerably (so do not use them!).

Colors are defined separately for each vertex. The color of a polygon, in this case with flat-shaded polygons, is the color of the last vertex used to form that particular polygon. Note: No material or lighting is defined in this example. Another possibility is to use a single color per triangle strip, by using glColor4[f/x] and disabling GL_COLOR_ARRAY.

3.1 Capabilities

The application has only CAP_APPLICATION capability as it only needs the rights to execute and access to the screen.

3.2 ScalabaleUI

All Open GL ES examples support various screen modes. The examples also support changing the screen size while the application is running.

© Nokia 2006

Back to top