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

Function glutDisplay

Samples/NiUserTracker/main.cpp:217–252  ·  view source on GitHub ↗

this function is called each frame

Source from the content-addressed store, hash-verified

215
216// this function is called each frame
217void 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
255void glutIdle (void)

Callers 2

mainFunction · 0.70
DrawSceneMethod · 0.50

Calls 6

DrawDepthMapFunction · 0.85
WaitOneUpdateAllMethod · 0.80
GetMetaDataMethod · 0.45
XResMethod · 0.45
YResMethod · 0.45
GetUserPixelsMethod · 0.45

Tested by

no test coverage detected