java.lang.Object
technology.sola.engine.core.GameLoop
technology.sola.engine.core.FixedUpdateGameLoop
- All Implemented Interfaces:
Runnable
FixedUpdateGameLoop is a
GameLoop
implementation that runs an update method at desired target updates per
second and renders whenever an update is available. If there is no update, then the thread running it will
take a short rest.-
Nested Class Summary
Nested classes/interfaces inherited from class technology.sola.engine.core.GameLoop
GameLoop.FpsTracker
-
Field Summary
Fields inherited from class technology.sola.engine.core.GameLoop
deltaTime, eventHub, fpsTracker, previousLoopStartNanos, renderMethod, updateCatchUpAccumulator, updateMethod
-
Constructor Summary
ConstructorsConstructorDescriptionFixedUpdateGameLoop
(EventHub eventHub, Consumer<Float> updateMethod, Runnable renderMethod, int targetUpdatesPerSecond) Creates an instance of the game loop. -
Method Summary
-
Constructor Details
-
FixedUpdateGameLoop
public FixedUpdateGameLoop(EventHub eventHub, Consumer<Float> updateMethod, Runnable renderMethod, int targetUpdatesPerSecond) Creates an instance of the game loop.- Parameters:
eventHub
- theEventHub
instanceupdateMethod
- the update method to run at target updates per secondrenderMethod
- the render method to run whenever there is an updatetargetUpdatesPerSecond
- the target updates per second
-
-
Method Details