PDA

View Full Version : Frame per second



Rajiv Mishra
09-03-2001, 08:09 PM
In my application an object of opengl rotate continuously.How i find the fps(frame per second)for that Object.

Bob
09-03-2001, 10:38 PM
Calculate the time it takes to render that frame. fps = 1/time.

Rajiv Mishra
09-03-2001, 10:46 PM
Bob,
please give some detail for clearity.

With regards
Rajiv Kumar

topSurfeur
09-04-2001, 12:08 AM
hi,

You will find an exe/src about what you search. It is in french ...I don't know if it is the best but for me, it works well.

link for the fps
http://ibelgique.ifrance.com/Slug-Production/Download/Fps.zip


link for all
http://ibelgique.ifrance.com/Slug-Production/Francais/Fichiers/Download.htm

09-04-2001, 09:58 PM
Does anyone know of a non windows specific fps counter code? I've found a lot that are windows specific but haven't found a single one that isn't. The glut timerfunc does not seem to update itself often enough to be effective.

cyclone
09-04-2001, 11:48 PM
long start, end, frames;

void init_fps()
{
start = time(NULL);
frames = 0;
}

void get_fps()
{
end = time(NULL);
frames++;
if(start != end)
printf("FPS : %f \n", (float)frames/(float)(end-time));
}


You have only to make a call init_fps() in the beginning and call get_fps() at the end of each redisplay.

@+
Cyclone

cyclone
09-04-2001, 11:52 PM
I have make a error in the get_fps(), the calculation is frames/(end-start) ...

void get_fps()
{
end = time(NULL);
frames++;
if(start != end)
printf("FPS : %f \n", (float)frames/(float)(end-start));
}

@+
Cyclone

Rajiv Mishra
09-05-2001, 01:11 AM
Hello Cyclone,
Many-Many Thanks,
Rajiv Kumar