Vital.sandbox
Rendertarget

self:set_active

Client

Sets this instance as the active rendertarget


Syntax

local status = self:set_active(clear = false, instant = false)

Parameters

TypeNameDescription
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 and verify its state
local rt = rendertarget.create(1920, 1080, false)

rt:set_active(true)
engine.print("info", "Is rendertarget active:", rt:is_active()) --true

On this page