Code cleanup and formatting.
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / gui / ViewRenderListener.java
1 /*
2  * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of version 3 of the GNU Lesser General Public License
6  * or later as published by the Free Software Foundation.
7  *
8  */
9
10 package eu.svjatoslav.sixth.e3d.gui;
11
12 public interface ViewRenderListener {
13
14     /**
15      * Notifies that it is about time to render next frame and
16      * allows listener to do any related processing that it needs to.
17      * <p>
18      * Each {@link ViewRenderListener} will be notified exactly once before every frame is rendered.
19      * <p>
20      * {@link ViewRenderListener} can determine if frame repaint is actually
21      * needed from its perspective. Frame will be rendered only if at least one listener says yes.
22      *
23      * @return <code>true</code> if underlying view shall be re-rendered. If at least one of the view update listeners
24      * returns <code>true</code>, view is re-rendered.
25      */
26     boolean beforeRender(ViewPanel viewPanel, final int millisecondsSinceLastFrame);
27 }