| 318 | |
| 319 | |
| 320 | void SceneDrawer::glutDisplay (void) |
| 321 | { |
| 322 | glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
| 323 | |
| 324 | // Setup the OpenGL viewpoint |
| 325 | glMatrixMode(GL_PROJECTION); |
| 326 | glPushMatrix(); |
| 327 | glLoadIdentity(); |
| 328 | XnUInt16 g_nXRes; |
| 329 | XnUInt16 g_nYRes; |
| 330 | SceneDrawer *singleton=GetInstance(); |
| 331 | |
| 332 | singleton->m_pUserTrackerObj->GetImageRes(g_nXRes,g_nYRes); |
| 333 | |
| 334 | #ifndef USE_GLES |
| 335 | glOrtho(0, g_nXRes, g_nYRes, 0, -1.0, 1.0); |
| 336 | #else |
| 337 | glOrthof(0, g_nXRes, g_nYRes, 0, -1.0, 1.0); |
| 338 | #endif |
| 339 | |
| 340 | glDisable(GL_TEXTURE_2D); |
| 341 | |
| 342 | if(singleton->g_bPause==FALSE) |
| 343 | singleton->m_pUserTrackerObj->UpdateFrame(); |
| 344 | if(singleton->m_pUserTrackerObj->GetExitPoseState(0)>=1.0f) |
| 345 | { |
| 346 | singleton->ExitSample(EXIT_SUCCESS); |
| 347 | } |
| 348 | // Process the data |
| 349 | singleton->DrawDepthMapTexture(); |
| 350 | |
| 351 | XnUserID aUsers[15]; |
| 352 | XnUInt16 nUsers = 15; |
| 353 | xn::UserGenerator *pUserGenerator=singleton->m_pUserTrackerObj->GetUserGenerator(); |
| 354 | pUserGenerator->GetUsers(aUsers, nUsers); |
| 355 | for (int i = 0; i < nUsers; ++i) |
| 356 | { |
| 357 | if (singleton->g_bPrintID) |
| 358 | { |
| 359 | singleton->DrawLabels(aUsers[i]); |
| 360 | } |
| 361 | if (singleton->g_bDrawSkeleton) |
| 362 | { |
| 363 | if(pUserGenerator->GetSkeletonCap().IsTracking(aUsers[i])) |
| 364 | { |
| 365 | singleton->DrawSkeleton(aUsers[i]); |
| 366 | } |
| 367 | |
| 368 | } |
| 369 | |
| 370 | } |
| 371 | |
| 372 | #ifndef USE_GLES |
| 373 | glutSwapBuffers(); |
| 374 | #endif |
| 375 | } |
| 376 | |
| 377 |
nothing calls this directly
no test coverage detected