Renderer

actual class Renderer

Renderer represents an operating system window and manages frame rendering and pacing.

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

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

Typical render loop:

while (!quit) {
if (renderer.beginFrame(swapChain)) {
renderer.render(view)
renderer.endFrame()
}
}

Frame pacing: beginFrame() manages frame pacing and returns false if the GPU is falling behind (to skip frames and reduce latency). When false is returned, either skip the frame or proceed anyway; if proceeding, you must still call endFrame().

See also

expect class Renderer

Renderer represents an operating system window and manages frame rendering and pacing.

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

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

Typical render loop:

while (!quit) {
if (renderer.beginFrame(swapChain)) {
renderer.render(view)
renderer.endFrame()
}
}

Frame pacing: beginFrame() manages frame pacing and returns false if the GPU is falling behind (to skip frames and reduce latency). When false is returned, either skip the frame or proceed anyway; if proceeding, you must still call endFrame().

See also

actual class Renderer

Renderer represents an operating system window and manages frame rendering and pacing.

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

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

Typical render loop:

while (!quit) {
if (renderer.beginFrame(swapChain)) {
renderer.render(view)
renderer.endFrame()
}
}

Frame pacing: beginFrame() manages frame pacing and returns false if the GPU is falling behind (to skip frames and reduce latency). When false is returned, either skip the frame or proceed anyway; if proceeding, you must still call endFrame().

See also

actual class Renderer

Renderer represents an operating system window and manages frame rendering and pacing.

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

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

Typical render loop:

while (!quit) {
if (renderer.beginFrame(swapChain)) {
renderer.render(view)
renderer.endFrame()
}
}

Frame pacing: beginFrame() manages frame pacing and returns false if the GPU is falling behind (to skip frames and reduce latency). When false is returned, either skip the frame or proceed anyway; if proceeding, you must still call endFrame().

See also

actual class Renderer

Renderer represents an operating system window and manages frame rendering and pacing.

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

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

Typical render loop:

while (!quit) {
if (renderer.beginFrame(swapChain)) {
renderer.render(view)
renderer.endFrame()
}
}

Frame pacing: beginFrame() manages frame pacing and returns false if the GPU is falling behind (to skip frames and reduce latency). When false is returned, either skip the frame or proceed anyway; if proceeding, you must still call endFrame().

See also

Constructors

Link copied to clipboard
constructor(jsRenderer: Renderer, _engine: Engine? = null)
constructor(engineRef: Engine, nativeHandle: MemorySegment?)
constructor(nativeHandle: CPointer<FilaRenderer>?)

Types

Link copied to clipboard
actual class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

expect class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

actual class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

actual class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

actual class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

Link copied to clipboard
actual object Companion
expect object Companion
actual object Companion
actual object Companion
actual object Companion
Link copied to clipboard
actual class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

expect class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

actual class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

actual class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

actual class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

Link copied to clipboard
actual class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

expect class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

actual class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

actual class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

actual class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

Properties

Link copied to clipboard

Get/set clear behavior for the SwapChain.

Get/set clear behavior for the SwapChain.

Get/set clear behavior for the SwapChain.

Get/set clear behavior for the SwapChain.

Get/set clear behavior for the SwapChain.

Link copied to clipboard

Get/set display information for frame pacing and dynamic resolution.

Get/set display information for frame pacing and dynamic resolution.

Get/set display information for frame pacing and dynamic resolution.

Get/set display information for frame pacing and dynamic resolution.

Get/set display information for frame pacing and dynamic resolution.

Link copied to clipboard
actual val engine: Engine

Get the Engine that created this Renderer.

expect val engine: Engine

Get the Engine that created this Renderer.

actual val engine: Engine

Get the Engine that created this Renderer.

actual val engine: Engine

Get the Engine that created this Renderer.

actual val engine: Engine

Get the Engine that created this Renderer.

Link copied to clipboard

Get/set frame rate control and dynamic resolution options.

Get/set frame rate control and dynamic resolution options.

Get/set frame rate control and dynamic resolution options.

Get/set frame rate control and dynamic resolution options.

Get/set frame rate control and dynamic resolution options.

Link copied to clipboard
actual val frameToSkipCount: Int

Get the number of frames left to skip.

expect val frameToSkipCount: Int

Get the number of frames left to skip.

actual val frameToSkipCount: Int

Get the number of frames left to skip.

actual val frameToSkipCount: Int

Get the number of frames left to skip.

actual val frameToSkipCount: Int

Get the number of frames left to skip.

Link copied to clipboard
var nativeHandle: MemorySegment?
var nativeHandle: CPointer<FilaRenderer>?
Link copied to clipboard
val nativeRenderer: Renderer
Link copied to clipboard
actual val userTime: Double

Get elapsed time since resetUserTime() in seconds.

expect val userTime: Double

Get elapsed time since resetUserTime() in seconds.

actual val userTime: Double

Get elapsed time since resetUserTime() in seconds.

actual val userTime: Double

Get elapsed time since resetUserTime() in seconds.

actual val userTime: Double

Get elapsed time since resetUserTime() in seconds.

Functions

Link copied to clipboard
actual fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

expect fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

actual fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

actual fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

actual fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

Link copied to clipboard
actual fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

expect fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

actual fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

actual fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

actual fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

Link copied to clipboard
actual fun endFrame()

Finish the current frame and schedule it for display.

expect fun endFrame()

Finish the current frame and schedule it for display.

actual fun endFrame()

Finish the current frame and schedule it for display.

actual fun endFrame()

Finish the current frame and schedule it for display.

actual fun endFrame()

Finish the current frame and schedule it for display.

Link copied to clipboard
actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

expect fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

expect fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

Link copied to clipboard
actual fun render(view: View)

Render a View into this Renderer's target.

expect fun render(view: View)

Render a View into this Renderer's target.

actual fun render(view: View)

Render a View into this Renderer's target.

actual fun render(view: View)

Render a View into this Renderer's target.

actual fun render(view: View)

Render a View into this Renderer's target.

Link copied to clipboard
actual fun renderStandaloneView(view: View)

Render a View without frame pacing.

expect fun renderStandaloneView(view: View)

Render a View without frame pacing.

actual fun renderStandaloneView(view: View)

Render a View without frame pacing.

actual fun renderStandaloneView(view: View)

Render a View without frame pacing.

actual fun renderStandaloneView(view: View)

Render a View without frame pacing.

Link copied to clipboard
actual fun resetUserTime()

Reset the user time clock to zero.

expect fun resetUserTime()

Reset the user time clock to zero.

actual fun resetUserTime()

Reset the user time clock to zero.

actual fun resetUserTime()

Reset the user time clock to zero.

actual fun resetUserTime()

Reset the user time clock to zero.

Link copied to clipboard
actual fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

expect fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

actual fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

actual fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

actual fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

Link copied to clipboard
actual fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

expect fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

actual fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

actual fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

actual fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

Link copied to clipboard

Check if the current frame should be rendered.

Check if the current frame should be rendered.

Check if the current frame should be rendered.

Check if the current frame should be rendered.

Check if the current frame should be rendered.

Link copied to clipboard
actual fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

expect fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

actual fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

actual fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

actual fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

Link copied to clipboard
actual fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.

expect fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.

actual fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.

actual fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.

actual fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.