|
Nokia N97 SDK Example Applications Guide |
#include <Slideshowrenderers.h>
This class draws a textured polygon that covers the entire screen.
Definition at line 25 of file Slideshowrenderers.h.
Public Member Functions |
|
| void | Render (const TTexture &texture, TBool filter) |
|
||||||||||||
|
Draw a textured polygon that fills the entire screen.
Definition at line 22 of file Slideshowrenderers.cpp. Referenced by CSlideshow::AppCycle(). 00023 { 00024 GLfixed tw = 1 << 16; 00025 GLfixed th = 1 << 16; 00026 GLfixed texCoords[] = 00027 { 00028 0, th, 00029 tw, th, 00030 0, 0, 00031 tw, 0, 00032 }; 00033 GLfixed vertices[] = 00034 { 00035 0, 0, 00036 1 << 16, 0, 00037 0, 1 << 16, 00038 1 << 16, 1 << 16, 00039 }; 00040 00041 // Set orthogonal projection 00042 glMatrixMode(GL_PROJECTION); 00043 glPushMatrix(); 00044 glLoadIdentity(); 00045 glOrthof(0, 1, 0, 1, -1, 1); 00046 glMatrixMode(GL_MODELVIEW); 00047 glLoadIdentity(); 00048 00049 // Set texture parameters 00050 glBindTexture(GL_TEXTURE_2D, texture.iID); 00051 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter ? GL_LINEAR : GL_NEAREST); 00052 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter ? GL_LINEAR : GL_NEAREST); 00053 00054 // Draw the textured quad 00055 glEnableClientState(GL_VERTEX_ARRAY); 00056 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00057 glTexCoordPointer( 2, GL_FIXED, 0, texCoords ); 00058 glVertexPointer( 2, GL_FIXED, 0, vertices ); 00059 glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 ); 00060 00061 glMatrixMode( GL_PROJECTION ); 00062 glPopMatrix(); 00063 glMatrixMode( GL_MODELVIEW); 00064 }
|
|
© Nokia 2009 |