Re: JOGL display update problem
Posted by
Sven Gothel on
Dec 29, 2012; 11:02pm
URL: https://forum.jogamp.org/JOGL-display-update-problem-tp4027643p4027651.html
On 12/29/2012 12:02 PM, polirol [via jogamp] wrote:
> Hi everybody,
>
> I have this problem that is actually driving me crazy: looks like the display
> function does not update if the changes in the scene are triggered by a key
> pressed/relased/typed event.
>
> I have something like that:
>
> [imports]
>
> public class TestClass extends GLCanvas implements GLEventListener, KeyListener
> {
>
> private float t;
-> private _volatile_ float t;
volatile is your magic word here,
which gives you build-in thread synchronization (updates).
be aware .. this is a multi threaded use case already,
i.e. renderer and EDT (key/mouse input, etc) thread.
~Sven