core.rendertarget.set_active
Client
Sets the active rendertarget
Syntax
local status = core.rendertarget.set_active(
rendertarget = nil,
clear = false,
instant = false
)Parameters
| Type | Name | Description |
|---|---|---|
rendertarget | rendertarget | Rendertarget instance to set as active Omitting this argument will unset the currently active rendertarget |
bool | clear | Determines the clear state: • When true - clears the rendertarget upon binding• When false - preserves the existing contents |
bool | instant | Determines the clear timing: • When true - applies the clear immediately• When false - defers the clear to the next frame |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = core.rendertarget.create(1920, 1080, false)
-- Bind the rendertarget with a clear
core.rendertarget.set_active(entity, true)
-- Bind the rendertarget with an immediate clear
core.rendertarget.set_active(entity, true, true)
-- Unset the active rendertarget
core.rendertarget.set_active()