MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / glutDisplay

Method glutDisplay

Samples/NiUserSelection/SceneDrawer.cpp:320–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318
319
320void 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

Callers

nothing calls this directly

Calls 11

GetImageResMethod · 0.80
GetExitPoseStateMethod · 0.80
ExitSampleMethod · 0.80
DrawDepthMapTextureMethod · 0.80
GetUserGeneratorMethod · 0.80
DrawLabelsMethod · 0.80
IsTrackingMethod · 0.80
GetSkeletonCapMethod · 0.80
UpdateFrameMethod · 0.45
GetUsersMethod · 0.45
DrawSkeletonMethod · 0.45

Tested by

no test coverage detected