Skip to main content

Interface: Renderer

A Renderer instance represents an operating system's window.

Typically, applications create a Renderer per window. The Renderer generates drawing commands for the render thread and manages frame latency.

A Renderer generates drawing commands from a View, itself containing a Scene description.

Extends

  • PointerHolder

Properties

beginFrame()

beginFrame: (swapChain, timestamp) => boolean

Parameters

swapChain: SwapChain

timestamp: number

Returns

boolean

Defined in

src/types/Renderer.ts:65


endFrame()

endFrame: () => void

Returns

void

Defined in

src/types/Renderer.ts:67


isValid

readonly isValid: boolean

Get if the refernce to the native pointer is still valid and strong.

If this is false, this object has been manually released with release() and all other methods on this object will throw an Error.

Inherited from

PointerHolder.isValid

Defined in

src/types/PointerHolder.ts:37


render()

render: (view) => void

Parameters

view: View

Returns

void

Defined in

src/types/Renderer.ts:66


setClearContent()

setClearContent: (clear) => void

Whether the View should be cleared using the clearColor. Use this if translucent View will be drawn, for instance.

Parameters

clear: boolean

Returns

void

Default

true

Defined in

src/types/Renderer.ts:58


setFrameRateOptions()

setFrameRateOptions: (options) => void

Parameters

options: FrameRateOptions

Returns

void

Defined in

src/types/Renderer.ts:51


setPresentationTime()

setPresentationTime: (timestamp) => void

Set the current Frame's output presentation timestamp, in milliseconds.

Parameters

timestamp: number

Returns

void

Defined in

src/types/Renderer.ts:63

Methods

release()

release(): void

Manually release this reference to the native pointer. This will ensure that JS will no longer hold a strong reference, and memory can be safely cleaned up.

If the native pointer is still referenced elsewhere in native code, the underlying memory will not be deleted unless the other references are also released.

If this is not called, the memory will only be cleaned once the JS gabage collector decides to delete this object, which might be at any point in the future.

Calling release() is not required as the GC will destroy this object eventually anyways, but it is recommended to optimize memory usage.

After manually releasing a pointer, all future methods on this object will throw an Error.

Returns

void

Inherited from

PointerHolder.release

Defined in

src/types/PointerHolder.ts:30