Class GameLoop
java.lang.Object
ActiverseEngine.GameLoop
- All Implemented Interfaces:
Runnable
Represents a highly parallelized game loop maximizing CPU usage while maintaining stability.
Threads are split across update/render responsibilities with precise frame pacing.
- Version:
- 1.4.0
- Author:
- Knivier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the target frames per second (FPS) for the game loop.boolean
Returns whether dynamic lighting is enabled in the game loop.void
run()
void
start()
Starts the game loop on separate threads for update and render.void
stop()
Stops the game loop and waits for threads to finish.
-
Constructor Details
-
GameLoop
-
-
Method Details
-
start
public void start()Starts the game loop on separate threads for update and render. This method initializes the threads and begins the game loop. -
stop
public void stop()Stops the game loop and waits for threads to finish. This method safely terminates the update and render threads, -
run
-
getTargetFps
public long getTargetFps()Returns the target frames per second (FPS) for the game loop. This value is loaded from the properties file or defaults to 60 FPS.- Returns:
- the target FPS
-
isDynamicLighting
public boolean isDynamicLighting()Returns whether dynamic lighting is enabled in the game loop. This value is loaded from the properties file or defaults to false.- Returns:
- true if dynamic lighting is enabled, false otherwise
-