org.xith3d.loop
Interface FPSLimiter

All Known Implementing Classes:
DefaultFPSLimiter, SmoothFPSLimiter

public interface FPSLimiter

An FPSLimiter is capable of waiting each frame until the desired FPS is limited (the minimal iteration time is reached.


Method Summary
 long limitFPS(long frameIdx, long frameTime, long minFrameTime, org.jagatoo.util.timing.TimerInterface timer)
          Limits the FPS to a known value.
 

Method Detail

limitFPS

long limitFPS(long frameIdx,
              long frameTime,
              long minFrameTime,
              org.jagatoo.util.timing.TimerInterface timer)
Limits the FPS to a known value.

Parameters:
frameIdx - the index of the current frame (zero-based)
frameTime - the time needed to render the current frame (in nano-seconds)
minFrameTime - the minimal frame-time (in nano-seconds) If each frame would take exactly minFrameTime, the desired FPS would be exactly matched.
timer - a TimerInterface to retrieve the current time
Returns:
the wait-time, that is virtually added to the frame-time.