|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
1. About this Example
2. Prerequisites
3. Design and Implementation
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.
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.
Texture coordinates are defined in the same way as the color values, that is, per vertex. Possible data types for texture coordinates are GL_BYTE, GL_SHORT, GL_FIXED, and GL_FLOAT. In this example, the defined coordinate type is GL_BYTE, and therefore the possible values are between [-128,127]. Both of the used texture sizes are 256x256 pixels.
After textures have been loaded with glTexImage2D(…), the original bitmaps can be deleted because the textures have been copied to OpenGL ES texture manager, that is, the textures are stored inside OpenGL ES. See the code in TextureAppUi.CPP for more information.When using lighting with texture mapping, the texture environment has to be changed from GL_REPLACE to GL_MODULATE.
The shading model should be set to GL_SMOOTH when using lighting. In this example, texture wrapping is implemented simply by changing the scale in texture matrix. Instead of scaling the texture coordinates by 1.f/255.f we scale them by 1.f/128.f. After that the texture coordinates are between [0,2], which causes the texture to wrap one time. See code in Texture.cpp.
Also use of blending can create nice-looking effects. In this example, blending is used to create a translucency effect. This effect can be enabled by pressing the joystick down.
This inheritance list is sorted roughly, but not completely, alphabetically:
|
© Nokia 2006 |