Lock FPS

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Pink Floyd
Posts: 32
Joined: Fri Jan 21, 2005 9:32 pm
Location: Genoa (Italy)

Lock FPS

Post by Pink Floyd »

Is there a way to lock the framerate to a value?
Saku
Posts: 158
Joined: Wed Jan 05, 2005 8:48 am
Location: Denmark

Post by Saku »

You could enable vsync on the devicewhich locks you fps to the maximum fps of your monitor.
Call me Wice, Miami Wice!
Saku
Posts: 158
Joined: Wed Jan 05, 2005 8:48 am
Location: Denmark

Post by Saku »

Here's the code:

Code: Select all

IrrlichtDevice *device = createDevice(GameRenderer, GameResolution, GameDepth, FullScreen, StencilBuffer, VSync, &receiver);
Set the VSync as "true" and your app will draw max the amount you monitor can handle (usually 60).

Edit: Important to notice that its the MAX fps so its isn't locked at the amount your monitor can handle, that's just the roof!
Call me Wice, Miami Wice!
Pink Floyd
Posts: 32
Joined: Fri Jan 21, 2005 9:32 pm
Location: Genoa (Italy)

Post by Pink Floyd »

thank you ;)
Post Reply