View Full Version : Framerate
How can i get current framerate of OpenGL program in SGI computer?...
05-24-2000, 09:14 PM
Here is the code I use.
// Updates frame rate every 5 seconds
LARGE_INTEGER currentTime; float fps;
// Get the frame count
nFrames = rsRenderData.uiFrames;
// Get the current Time
fps = (float)(nFrames - nLastFrames)/((float)(currentTime.QuadPart - startTime.QuadPart)/
sprintf(cOutBuffer,"fps %0.1f ",fps);
The above code is for Win32 platforms, and will most certainly not work on SGI computers. But the way to calculate it is still the same. Either calculate the time for any number of frame, or count the number of frames in any given time. fps=<number of frames>/<time in seconds> in both cases.
Can't post any code since I'm no UNIX programmer.
Check out the thread:
it tells you what man pages to look at to get timing info. (If you need more help, let me know...)
05-27-2000, 08:18 AM
You can get nanosecond resolution on SGI's with (I beleive) clock_gettime(SGI_REALTIME_CLOCK).
I am not 100% sure this is the name, but it is close.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.