PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

changing target fps on the fly? can it be done

title really say it all

is there any way to change the targetFPS on the fly like the way you can change the screen orientation?

my thought is that things like menus don't need a high target framerates, low rates like 10fps would probably be enough for most menus - allowing fancy effects + sounds to be done that would be too much to do in the actual game

at the moment the only way I can think of doing this is to acually close the gapi application, and then create a new one at the alternate frame rate - which of course means that you are re-loading any default surfaces

it's not the end of the world if it can't be done, but thought I'd check that I'm not missing anything obvious
Hi!

Yes you can. Simply call the StartTime() function of the CGapiTimer object with the new target FPS you need.

From the docs:

"It is safe to call StartTimer multiple times for the same objects, in case the frame rate need to be adjusted during game play."

HTH.

--Eric
excellent! many, many thanks - that's exactly what I was after :D