I want to write a game engine with JavaFX. In my current tests I am using a javafx.animation.Timeline
as my gameloop. The thing I don't like about the Timeline is that if the rendering process takes longer than the time between frames, the Timeline is trying to catch up and executes the code inside the loop like 30 times before displaying the rendered content once. After the frame has been displayed once, the same thing happen again.
Is there any way to make a gameloop without a Timeline or at least a way to detect whenever the Timeline is lagging behind, so I can lower the framerate if that happens?