Framerate independence?

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
Leo28C
Posts: 19
Joined: Thu Jan 18, 2007 8:20 am

Framerate independence?

Post by Leo28C »

Hello everyone! :-D

I remember, when coding in SDL for PC, the game would run at different speeds on various computers... There was a little routine to limit the number of frames rendered so it would run at a constant speed on any PC, but I forgot what that was! :-(

I'm not sure if this is needed at all on PSP, but I'd still like to have it... Anyone know how to? Thanks! ;-)
Altair
Posts: 76
Joined: Sat May 20, 2006 2:33 am
Location: The Netherlands

Post by Altair »

I guess you could do something like this:

Instead of:

Code: Select all

screen.waitVblankStart()
screen.flip()
You could use a timer (normally the PSP runs at 100Hz I believe? Anyway with screen.waitVblankStart() it refreshes every 1/60th second -> 60 Hz):

Code: Select all

if timer > whatever you want then
screen.flip()
I hope I got what you meant?
Post Reply