rendertarget.set_active

Client

Sets the active rendertarget


Syntax

local status = rendertarget.set_active(
    instance = nil,
    clear = false,
    instant = false
)

Parameters

TypeNameDescription
rendertargetinstanceRendertarget instance to set as active
Omitting this argument will unset the currently active rendertarget
boolclearDetermines the clear state:
• When true - clears the rendertarget upon binding
• When false - preserves the existing contents
boolinstantDetermines the clear timing:
• When true - applies the clear immediately
• When false - defers the clear to the next frame

Returns

TypeNameDescription
boolstatustrue on successful execution, or false on failure

Examples

Set a rendertarget as active with various clear options
local rt = rendertarget.create(1920, 1080, false)

-- Bind the rendertarget with a clear
rendertarget.set_active(rt, true)

-- Bind the rendertarget with an immediate clear
rendertarget.set_active(rt, true, true)

-- Unset the active rendertarget
rendertarget.set_active()

On this page