home
 
 index of namespace default
 
 index of project tksdl
 
 index of module tksdl

Class tksdl.FPS


SynopsisUtility class for measuring/controlling frames per second

  Base classes:
  Methods:
Method getAverage
Get average FPS rate (Hz)
Signature
getAverage():float
Returns
float

 
 top of page
Method getCurrent
Get current FPS (in Hz, extrapolated from last frame)
Signature
getCurrent():float
Returns
float

 
 top of page
Method getLimit
Query current FPS limit
Signature
getLimit():int
Returns
int

 
 top of page
Method getMax
Query maximum FPS rate
Signature
getMax():float
Returns
float

 
 top of page
Method getNumFramesRendered
Query total number of frames rendered
Signature
getNumFramesRendered()

 
 top of page
Method getPrecision
Return current precision.
Signature
getPrecision():float
Returns
float
Description

This can be used to determine the deviation of the current FPS rate from the desired one (tickInterval). A value > 1 means that the rendering is slower than the desired rate, a value < 1 means that it is faster.

 
 top of page
Method getReal
Return real interpolated frames per second
Signature
getReal():float
Returns
float

 
 top of page
Method getTickBuffer
Query current maximum number of ticks to catch up
Signature
getTickBuffer():int
Returns
int

 
 top of page
Method getTickInterval
Query current tick interval
Signature
getTickInterval():float
Returns
float

 
 top of page
Method getTotalTime
Get total time (millisec)
Signature
getTotalTime():int
Returns
int

 
 top of page
Method reset
Reset FPS counters.
Signature
reset()

 
 top of page
Method setLimit
Set FPS limit (in Hz)
Signature
setLimit(intlimit)
Arguments
intlimit0=unlimited, frame limit (Hz) otherwise
Description

This can be used to prevent the application from redrawing too often and thus can help to save CPU/GPU resources.

 
 top of page
Method setMax
Set maximum FPS rate (Hz).
Signature
setMax(floatmax)
Arguments
floatmax
Description
This affects the getPrecision() method

 
 top of page
Method setTickBuffer
Set the maximum number of ticks to catch up to if the rendering is too slow.
Signature
setTickBuffer(intsize)
Arguments
intsize
Description

Mostly useful for constant timeframe physics.

 
 top of page
Method setTickInterval
Set desired tick interval in millisec.
Signature
setTickInterval(floatinterval)
Arguments
floatinterval
Description

This affects the return value of the getPrecision() method. It also determines how often the tick() signal callback is invoked.

 
 top of page
 

Project Modules:tksdl 
Project Classes:AudioDevice , AudioSample , Cursor , FPS , Joystick , Key , Mouse , SamplePlayer , SDL , Viewport 
Project Functions:MIDINoteToFrequency 
All Namespaces:default , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 13:15:54