Guest User

Untitled

a guest
Jun 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. void displayFunc()
  2. {
  3. static double previousTickCount = (double)cvGetTickCount();
  4. static int frameCount = 0;
  5.  
  6. ///………
  7. glutSwapBuffers();
  8.  
  9. frameCount++;
  10. if (frameCount == FPS_STATS_NB_FRAMES)
  11. {
  12. frameCount = 0;
  13. double newTickCount = (double)cvGetTickCount();
  14. double fps = (cvGetTickFrequency()*1000000.0*FPS_STATS_NB_FRAMES)/(newTickCount-previousTickCount);
  15. previousTickCount = newTickCount;
  16. char title[100];
  17. sprintf(title, "VisualWall - %d fps", (int)(0.5+fps));
  18. glutSetWindowTitle(title);
  19. }
  20. }
Add Comment
Please, Sign In to add comment