Login  Register

Possible to have GLCanvas's display() called *after* all other Swing events?

Posted by farrellf on Nov 08, 2017; 7:54pm
URL: https://forum.jogamp.org/Possible-to-have-GLCanvas-s-display-called-after-all-other-Swing-events-tp4038306.html

Hi,

It looks like display() is called before some Swing events occur. For example, if you register a mouse listener on the enclosing JPanel, and have display() draw something at the mouse's "current" location, it looks like there is always a one frame delay.

I see similar delays if, for example, I resize the enclosing JPanel. The GLCanvas's size is always one frame old, so there's very obvious stuttering.

Is there any way to remove these delays? I assume this is because some Swing events occur after the GLCanvas's display() method is called.

If it is not possible to remove this delay, do I have any other options if I want my OpenGL drawing to properly line up with GUI events?

Thanks,
-Farrell