rendertarget_detach - Remove any secondary specific-object attachments
from a rendertarget
nil
rendertarget_detach( rtgt, vid )
Functions that attach video objects to rendertargets through rendertarget
creation or dynamically allow the primary attachment (responsible for
life-cycle management and similar properties) of an object to be modified.
Using the RENDERTARGET_NODETACH , the same functions can create
secondary attachments wherein a video object will be processed for multiple
rendertargets. This function can be used to dynamically undo secondary
attachments.
- 1
- Attempting to modify primary rendertargets this way will fail silently,
use rendertarget_attach or delete_image functions for
dynamic primary rendertarget manipulation.
- 2
- Attempting to detach from rendertargets where the specified object does
not exist will not result in any state transitions.
function rendertarget_detach0()
local rtgt = alloc_surface(64, 64);
local obj_a = color_surface(32, 32, 0, 255, 0);
rendertarget_attach(rtgt, obj_a, RENDERTARGET_NODETACH);
show_image({rtgt, obj_a});
move_image(rtgt, 64, 0);
rendertarget_detach(rtgt, obj_a);
end