Core · interface

FrameSource

A source of animation frames. window satisfies it, and so does an XRSession.

Explained in The loop.

interface FrameSource
import type { FrameSource } from '@driftengine/core';

In depth

Structural rather than a class, because both of the things that satisfy it are somebody else's: one is the browser's and one is a runtime's.

Methods

requestAnimationFrame

requestAnimationFrame(callback: (timeMs: number, frame?: unknown) => void): number
ParameterTypeDescription
callback(timeMs: number, frame?: unknown) => void

cancelAnimationFrame

cancelAnimationFrame(handle: number): void
ParameterTypeDescription
handlenumber