Skip to content

Class: RenderLoop ​

Experimental

Constructors ​

Constructor ​

ts
new RenderLoop(render, options?): RenderLoop;

Experimental

Parameters ​

ParameterType
render(info) => void
optionsRenderLoopOptions

Returns ​

RenderLoop

Accessors ​

animating ​

Get Signature ​

ts
get animating(): boolean;

Experimental

Whether any animation token is held.

Returns ​

boolean


frameCount ​

Get Signature ​

ts
get frameCount(): number;

Experimental

Number of frames rendered so far.

Returns ​

number


paused ​

Get Signature ​

ts
get paused(): boolean;

Experimental

Returns ​

boolean


pending ​

Get Signature ​

ts
get pending(): boolean;

Experimental

Whether a frame is scheduled.

Returns ​

boolean

Methods ​

dispose() ​

ts
dispose(): void;

Experimental

Returns ​

void


flush() ​

ts
flush(): void;

Experimental

Render synchronously now if a frame is pending (e.g. right after a resize, or for export).

Returns ​

void


invalidate() ​

ts
invalidate(): void;

Experimental

Mark the scene dirty; a frame renders on the next animation frame.

Returns ​

void


on() ​

ts
on<K>(type, listener): () => void;

Experimental

Type Parameters ​

Type Parameter
K extends keyof RenderLoopEvents

Parameters ​

ParameterType
typeK
listener(payload) => void

Returns ​

() => void


requestAnimation() ​

ts
requestAnimation(): () => void;

Experimental

Enter continuous mode until the returned release function is called. Tokens are ref-counted; calling the release function more than once is a no-op.

Returns ​

() => void


setPaused() ​

ts
setPaused(paused): void;

Experimental

Pause/resume scheduling (used while the WebGL context is lost). Invalidations while paused are remembered and rendered on resume.

Parameters ​

ParameterType
pausedboolean

Returns ​

void

Released under the MIT License.