Hi,
I handled this differently in Jzy3D :
- a "repaint continuously" mode use the animator as you do and do not check if a repaint was necessary or not.
- a "repaint on demand" mode use no animator but force a canvas repaint if the scene changes. Hence I only have to deal with scene change detection in
my code rather than trying to decipher what AWT/Swing/SWT/JavaFX decided to do for reason that are not easy to fully understand, that may depend on the OS you are actually running and that may change among JDK versions.
Trying to understand when AWT will render took me lot of time and I just understood that it is quite unpredictable.
I summarized this here. Maybe other windowing toolkit are easier to understand, I don't know.
For example I tried overriding the AWT canvas paint() method (or paintComponent(), I forgot) but as you may read from the link above, you can't be sure that the call to canvas.paint() will actually lead to screen repaint in the JVM. Overriding your canvas paint() method to store this info somewhere may be a way to know if your GLEventListener was invoked because of an OS query, but you are not sure if this will really be applied.
Another idea would be to understand what part of your rendering is slow and fix this to let the animator run.
I tend to favor "repaint on demain" over "repaint continuously". I mainly kept the animator for rare cases where the GLEventListener (and actually the canvas) does not get properly notified of reshape queries. This mainly occured when combining a GLCanvas with an old version of MigLayout.
Hope this helps.