From 99cc27235b226ba7a6d94bc3c8308601f611daad Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Wed, 10 May 2023 22:22:32 +0300 Subject: [PATCH] Improved code readability --- src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java index 184ddba..e068bf5 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java @@ -28,11 +28,18 @@ public class ViewPanel extends JPanel implements ComponentListener { private final ShapeCollection rootShapeCollection = new ShapeCollection(); private final Set viewRenderListeners = ConcurrentHashMap.newKeySet(); public Color backgroundColor = Color.BLACK; + /** - * Last time this view was updated. + * Stores milliseconds when last frame was updated. This is needed to calculate time delta between frames. + * Time delta is used to calculate smooth animation. */ private long lastUpdateMillis = 0; + + /** + * Timer that is used to update canvas at target FPS rate. + */ private Timer canvasUpdateTimer; + private ViewUpdateTimerTask canvasUpdateTimerTask; private RenderingContext renderingContext = null; -- 2.20.1