this function is called each frame
| 215 | |
| 216 | // this function is called each frame |
| 217 | void glutDisplay (void) |
| 218 | { |
| 219 | |
| 220 | glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| 221 | |
| 222 | // Setup the OpenGL viewpoint |
| 223 | glMatrixMode(GL_PROJECTION); |
| 224 | glPushMatrix(); |
| 225 | glLoadIdentity(); |
| 226 | |
| 227 | xn::SceneMetaData sceneMD; |
| 228 | xn::DepthMetaData depthMD; |
| 229 | g_DepthGenerator.GetMetaData(depthMD); |
| 230 | #ifndef USE_GLES |
| 231 | glOrtho(0, depthMD.XRes(), depthMD.YRes(), 0, -1.0, 1.0); |
| 232 | #else |
| 233 | glOrthof(0, depthMD.XRes(), depthMD.YRes(), 0, -1.0, 1.0); |
| 234 | #endif |
| 235 | |
| 236 | glDisable(GL_TEXTURE_2D); |
| 237 | |
| 238 | if (!g_bPause) |
| 239 | { |
| 240 | // Read next available data |
| 241 | g_Context.WaitOneUpdateAll(g_UserGenerator); |
| 242 | } |
| 243 | |
| 244 | // Process the data |
| 245 | g_DepthGenerator.GetMetaData(depthMD); |
| 246 | g_UserGenerator.GetUserPixels(0, sceneMD); |
| 247 | DrawDepthMap(depthMD, sceneMD); |
| 248 | |
| 249 | #ifndef USE_GLES |
| 250 | glutSwapBuffers(); |
| 251 | #endif |
| 252 | } |
| 253 | |
| 254 | #ifndef USE_GLES |
| 255 | void glutIdle (void) |
no test coverage detected