rendertarget_bind(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

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 🧚

  1. 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.
  2. After rebinding, the fsrv vid can be deleted, because the underlying frameserver connection is now bound to rt. 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