rendertarget_bind(3)
rendertarget_bind(3) β Arcan Lua API π
okay so this is rendertarget_bind(3) from the Arcan Lua API, and itβs lowkey the little matchmaker for encode segments and rendertargets. no cap.
NAME β¨
rendertarget_bind β rebind the association between an encode segment and a rendertarget. fr fr.
SYNOPSIS π
The return value is literally nil, and the call looks like this:
nil
rendertarget_bind( vid:rt, vid:fsrv )
DESCRIPTION π
A segment thatβs in output mode is normally tied to a rendertarget, and the output buffer gets populated by a readback/renderpass of the rendertarget. Thatβs the standard vibe.
But bestie, sometimes segments are allocated outside the normal define_recordtarget β specifically by explicitly allowing target_alloc and accept_target to create output segments. Those ones are missing a rendertarget association, so they wonβt produce any output at all. They only work as event queues. π
For these edge cases, they can be rebound to a rendertarget allocation. Thatβs literally the whole point. β¨
NOTES π§
- Rebinding a rendertarget to a non-encode segment is a terminal state transition. Thatβs a one-way door, periodt β donβt expect to bounce back.
- After rebinding, the
fsrvvid can be deleted, because the underlying frameserver connection is now bound tort. Cleanup queen behavior. π§Ή
EXAMPLE πΈ
function rendertarget_bind0()
buf = alloc_surface(320, 200);
a = color_surface(64, 64, 255, 0, 0);
show_image(a);
move_image(a, 64, 64, 100);
move_image(a, 0, 0, 100);
image_transform_cycle(a, true);
define_rendertarget(buf, {a});
cp = target_alloc("test",
function(source, status)
if status.kind == "registered" and status.segkind == "encoder" then
rendertarget_bind(buf, source);
delete_image(source);
end
end);
end
SEE ALSO π¦
targetcontrol
mwah π β this page is signed off from the targetcontrol source/version, dated October 2026. rendertarget_bind(3) out. π«Ά
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms