Re: AnimationScheduler.requestAnimationFrame example
Something along the lines of ... Notice the line under "Call it again."
animation = AnimationScheduler.get().requestAnimationFrame(new
AnimationCallback() {
@Override
public void execute(double timestamp) {
// Do some stuff here
// Call it again.
AnimationScheduler.get().requestAnimationFrame(this);
}
}
});
Regards,
Alfredo
On Fri, Oct 26, 2012 at 8:43 AM, Arun <arunk.siluvery@gmail.com> wrote:
>
> Hi Everyone,
>
> I am beginning to learn WebGL development using GWT using gwtgl.
> I am not able to get the requestAnimationFrame working to render my scene regularly.
> Could someone please take a look at it and offer some advice?
>
> Code:
>
> Mygwtgl.java
> public class Mygwtgl implements EntryPoint, AnimationScheduler.AnimationCallback {
> ...
> private Redraw redraw;
> private void start() {
> ...
> redraw = new Redraw();
> redraw.requestAnimationFrame(this);
> }
> public void execute(double timestamp) {
> drawScene();
> }
> }
>
> Redraw.java
> public class Redraw extends AnimationScheduler {
> private AnimationScheduler.AnimationHandle hAnimScheduler;
> public Redraw() {
> hAnimScheduler = new AnimationScheduler.AnimationHandle() {
> @Override
> public void cancel() {
> // TODO Auto-generated method stub
> }
> };
> }
> public AnimationScheduler.AnimationHandle requestAnimationFrame(AnimationScheduler.AnimationCallback cb, Element e) {
>
> // cb.execute() works here but only once, not getting scheduled regularly
> //
>
> return hAnimScheduler;
> }
> }
>
> I do not have much programming experience with java and I am not sure whether this is the correct way to use requestAnimationFrame().
> The callback doesn't seem to be scheduled,
> I really appreciate any advice in this regard.
>
> -br
> Arun
>
> --
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/-y4hkIDt5BUJ.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
--
Alfredo Quiroga-Villamil
AOL/Yahoo/Gmail/MSN IM: lawwton
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home