Login  Register

Re: Couple of questions

Posted by Sven Gothel on Nov 12, 2010; 9:04pm
URL: https://forum.jogamp.org/Couple-of-questions-tp1889246p1891463.html

On Friday, November 12, 2010 15:53:18 tomd [via jogamp] wrote:
>
> I have the gears demo running in the main window of my existing application,
> which is a great step forward. Just a couple of questions.
>
> My application is largely static, the scene changes rarely. It seems quite
> wasteful to redraw the frame over and over when it isn't even changing. But
> I can't seem to get GLCanvas to paint itself outside of the Animator - I get
> null pointers because the canvas doesn't appear to be fully initialised. Is
> it possible to just draw the canvas once, without the animator?

It should be possible, sure.
Works with NEWT though.
Wait until the upcoming builds and file a bug report,
look at the wiki how to do this right.
I assume Wade had a similar 'experience'.

>
> Also, I notice in the gears example, the mouse handler updates xRot amd
> yRot, which the display callback uses to position the gears. Is that thread
> safe, there is no synchronisation? Not sure if it is just to keep the
> example simple, or if there is a reason the two areas of code can't trip
> each other up?

Good point.
If you use an animator it's not 'thread safe' correct,
but I guess the demo is coming from the one thread AWT ages :)
So with NEWT it's not safe, however this data is not as critical
as memory references would be - I assume.

~Sven