MCPcopy Create free account
hub / github.com/assimp/assimp / do_motion

Function do_motion

samples/SimpleOpenGL/Sample_SimpleOpenGL.c:274–295  ·  view source on GitHub ↗

---------------------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

272
273/* ---------------------------------------------------------------------------- */
274void do_motion (void)
275{
276 static GLint prev_time = 0;
277 static GLint prev_fps_time = 0;
278 static int frames = 0;
279
280 int time = glutGet(GLUT_ELAPSED_TIME);
281 angle += (float)((time-prev_time)*0.01);
282 prev_time = time;
283
284 frames += 1;
285 if ((time - prev_fps_time) > 1000) /* update every seconds */
286 {
287 int current_fps = frames * 1000 / (time - prev_fps_time);
288 printf("%d fps\n", current_fps);
289 frames = 0;
290 prev_fps_time = time;
291 }
292
293
294 glutPostRedisplay ();
295}
296
297/* ---------------------------------------------------------------------------- */
298void display(void)

Callers 1

displayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected