How does one control the animator speed?
Is it possible that animator would force another display call even if the previous one hasn’t completed yet?
Jim
How does one control the animator speed?
Is it possible that animator would force another display call even if the previous one hasn’t completed yet?
Jim
The Animator will run as fast as it can and will not force another display call before the previous is finished.
I’m wondering if I can slow the Animator down though. Its runningn like you say, as fast as it can, which is pegging my CPU to 100% and slowing everything else to a crawl. My rendering is small so its hitting display about 5 times a millisecond!
Are there any options to slow it down? Can I access it’s thread? I tried doing a wait on it but it doesn’t recongize my GLEngine class as its monitor.
Any ideas here would be much appreciated.
It’s easy to put a sleep in your display method in your GLEventListener. It’s lazy, but it works. It’s better to reimplement Animator and add the sleep in it’s run method.
being somewhat new to Java and OpenGL this maybe some stupid questions.
sleep says its undefined for my class. So I’m at a bit of a loss as to how to implement sleep…
I’m more intreged by implementing my own animator. What in animator forces the display updates (buffer swap)? If I call display from within my methods no change in display occurrs, if animator calls them the changes take place. So what do I need to make display functions update, simply call the methods from a class called animator?
Thanks for your patience.
Jim
grab a comfy pillow and sink in…
or
invoke the static void sleep(long) method in Thread class.
try {
…
Thread.sleep(1000); // this is one second
…
}
duh! Thanks for that! It solves it.
Would also like to know more about the majic of animator too. What does it do to force updates that I can’t seem to do without it. I’m assuming it is something to do with swap buffers.
Jim