Page 1 of 1

Framerate how?

Posted: Mon Jan 23, 2006 9:37 pm
by Ghoti
Hi folks,

I have a question. How can you calculate the framerate?

i need the function that get the current time.

this way i can save it loop through the game 1 frame. compare the new time with the old time. see how much time has passed in 1 frame with that i can calculate the steps of my enemies and there speed.

what function do i need to get the time?

greets Ghoti

Posted: Wed Jan 25, 2006 3:43 am
by weltall
you could use the cputicks or the timer function which were posted somewhere around with a timer manager.
you could also measure vsinc which are of a precise number/s for the same standard (they differs beetween pal and ntsc)

Posted: Thu Jan 26, 2006 5:57 am
by Drakonite
Woops, I swore I replied to this the other day...

There is a cdReadClock call that will return the current time, however it is an EXTREMELY expensive call and should be avoided.

Setting up a timer is probably the most accurate and one of the fastest (performancewise) ways to go..
For an example, I think quake_ps2 uses timers to track the time, but I haven't looked so I could be wrong and I dunno if it's a good example or not.

Counting vblanks is an easy way to setup, but you have to worry about what TV standard is being used.

Posted: Thu Jan 26, 2006 6:17 am
by Ghoti
Ohw sorry sorry i posted this in the wrong forum is has to be in the PSP software section.
sorry

Posted: Thu Jan 26, 2006 6:52 am
by Drakonite
Um... wow. The answer would be entirely different then :P