public void start() { if (!ticking) { ticking = true; AnimationScheduler.get().requestAnimationFrame(this); } }
@Override public void execute (double timestamp) { try { mainLoop(); } catch (Throwable t) { error("GwtApplication", "exception: " + t.getMessage(), t); throw new RuntimeException(t); } AnimationScheduler.get().requestAnimationFrame(this, graphics.canvas); } }, graphics.canvas);
@Override public void execute (double timestamp) { try { mainLoop(); } catch (Throwable t) { error("GwtApplication", "exception: " + t.getMessage(), t); throw new RuntimeException(t); } AnimationScheduler.get().requestAnimationFrame(this, graphics.canvas); } }, graphics.canvas);
@Override public void execute(double timestamp) { if (ticking) { GamepadSupport.pollGamepads(); GamepadSupport.pollGamepadsStatus(); AnimationScheduler.get().requestAnimationFrame(this); } } }
AnimationScheduler.get().requestAnimationFrame(new AnimationCallback() { @Override public void execute (double timestamp) {
AnimationScheduler.get().requestAnimationFrame(new AnimationCallback() { @Override public void execute (double timestamp) {
@Override public void execute(double timestamp) { if (update(timestamp)) { // Schedule the next animation frame. requestHandle = scheduler.requestAnimationFrame(callback, element); } else { requestHandle = null; } } };
/** * Schedule an animation, letting the browser decide when to trigger the next * step in the animation. * * <p> * NOTE: If you are animating an element, use * {@link #requestAnimationFrame(AnimationCallback, Element)} instead so the * browser can optimize for the specified element. * </p> * * <p> * Using this method instead of a timeout is preferred because the browser is * in the best position to decide how frequently to trigger the callback for * an animation of the specified element. The browser can balance multiple * animations and trigger callbacks at the optimal rate for smooth * performance. * </p> * * @param callback the callback to fire * @return a handle to the requested animation frame * @see #requestAnimationFrame(AnimationCallback, Element) */ public AnimationHandle requestAnimationFrame(AnimationCallback callback) { return requestAnimationFrame(callback, null); }
@Override public void execute(double timestamp) { if (update(timestamp)) { // Schedule the next animation frame. requestHandle = scheduler.requestAnimationFrame(callback, element); } else { requestHandle = null; } } };
@Override public void execute(double timestamp) { if (update(timestamp)) { // Schedule the next animation frame. requestHandle = scheduler.requestAnimationFrame(callback, element); } else { requestHandle = null; } } };
private void kick() { if (commands.size() > 0) { AnimationScheduler.get().requestAnimationFrame(callback); } }
@Override protected final void tick() { if (m_refire) { m_refire = false; AnimationScheduler.get().requestAnimationFrame(m_action); } }
@Override protected final void tick() { if (m_refire) { m_refire = false; AnimationScheduler.get().requestAnimationFrame(m_action); } }
private void kick() { if (m_layers.size() > 0) { AnimationScheduler.get().requestAnimationFrame(m_redraw); } } }
private void kick() { if (m_layers.size() > 0) { AnimationScheduler.get().requestAnimationFrame(m_redraw); } } }
private void kick() { if (m_layers.length() > 0) { AnimationScheduler.get().requestAnimationFrame(m_redraw); } } }
@Override public void execute (double timestamp) { try { mainLoop(); } catch (Throwable t) { error("GwtApplication", "exception: " + t.getMessage(), t); throw new RuntimeException(t); } AnimationScheduler.get().requestAnimationFrame(this, graphics.canvas); } }, graphics.canvas);
private void kick() { if (m_layers.size() > 0) { AnimationScheduler.get().requestAnimationFrame(m_redraw); } } }
private static void frameLoop(double timestamp) { GwtInputDevice.pollControllers(); SilenceEngine.gameLoop.performLoopFrame(); // Request another frame AnimationScheduler.get().requestAnimationFrame(GwtRuntime::frameLoop); } }
@Override public IAnimationHandle run() { if (isRunning()) { return this; } m_running = true; m_begtime = System.currentTimeMillis(); doStart(); AnimationScheduler.get().requestAnimationFrame(getAnimationCallback()); return this; }