diff options
Diffstat (limited to '')
-rw-r--r-- | src/subconscious/graphics/Scene.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/subconscious/graphics/Scene.java b/src/subconscious/graphics/Scene.java index 1c5002d..bbc98eb 100644 --- a/src/subconscious/graphics/Scene.java +++ b/src/subconscious/graphics/Scene.java @@ -121,11 +121,16 @@ public abstract class Scene extends JPanel } } - Graphics2D g = (Graphics2D) this.buffer.getDrawGraphics(); + do { + do { + Graphics2D g = (Graphics2D) this.buffer.getDrawGraphics(); + this.render(g); + g.dispose(); + // repeat if the rendering buffer contents were restored + } while (this.buffer.contentsRestored()); + // repeat if the drawing buffer contents were lost + } while (this.buffer.contentsLost()); - this.render(g); - - g.dispose(); this.buffer.show(); lastUpdateTime = currentUpdateTime; |