The GameLoop controls the overall program flow.

The Singleton GameLoop provides events for the running application, including the main loop for scene updates and rendering as well as time- and framebased events for registered handlers. Furthermore it supports pausing and unpausing of the simulation.


start(TeetairApplication* application)
Summary:
Start the game loop for the given TeetairApplication.
lock()
Summary:
Locks the game loop mutex.
unlock()
Summary:
Unlocks the game loop mutex.
pause()
Summary:
Pause the game loop.
unpause()
Summary:
Unpause the game loop.
registerForTimedEvents(std::function<void()>& eventHandler, double stepsize)
Summary:
Register the given eventHandler for time-based events. It will from now be called every stepsize seconds.
Params:
eventHandler: The event handler.
stepsize: The stepsize in seconds.
unregisterFromTimedEvents(std::function<void()>& eventHandler, double stepsize)
Summary:
Unregister the given eventHandler from time-based events.
Params:
eventHandler: The event handler that was previously registered.
stepsize: The stepsize in seconds with which the handler was previously registered.
registerForFrameEvents(std::function<void()>& eventHandler)
Summary:
Register the given eventHandler for frame-based events. It will from now be called every frame.
Params:
eventHandler: The event handler.
unregisterFromFrameEvents(std::functionvoid()>& eventHandler)
Summary:
Unregister the given eventHandler from frame-based events.
Params:
eventHandler: The event handler that was previously registered.
getFrameStamp()
Summary:
Gets the frame stamp of the currently running TeetairApplication.
Returns:
The osg FrameStamp.