renderTarget

fun renderTarget(width: Int, height: Int, contentScale: Double = 1.0, multisample: BufferMultisample = BufferMultisample.Disabled, session: Session? = Session.active, builder: RenderTargetBuilder.() -> Unit): RenderTarget(source)

Creates a new render target with the specified dimensions and properties.

Return

A configured RenderTarget instance.

Parameters

width

The width of the render target in pixels. Must be greater than 0 and less than or equal to the maximum allowed texture size.

height

The height of the render target in pixels. Must be greater than 0 and less than or equal to the maximum allowed texture size.

contentScale

A scaling factor to apply to the render target's content. Defaults to 1.0.

multisample

Specifies the multisampling configuration for the render target. Defaults to BufferMultisample.Disabled.

session

The session to which the render target belongs. Defaults to the currently active session.

builder

A builder block for additional configuration of the render target.

Throws

If the specified width or height is out of the supported range.