fill_surface(3)

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

πŸ’… fill_surface(3) πŸ’…

okay so bestie, you're in the Arcan Lua API ✨ and today's main character is fill_surface(3) β€” she allocates a brand-new video object and fills it with one single colour. periodt. πŸ’–

πŸŽ€ NAME πŸŽ€

fill_surface β€” allocate a fresh new video object and fill it with a single colour. no cap, that's the whole vibe. 🌈

πŸ¦‹ SYNOPSIS πŸ¦‹

vid
fill_surface( objw, objh, r, g, b, storew, storeh )

🌸 DESCRIPTION 🌸

so fill_surface lowkey acts like a memory allocation function, in the sense that she creates a fully qualified video object β€” texture store included β€” and she's identical in capability to an image acquired from other sources, e.g. load_image. but she's especially useful for rendertargets, recordtargets and similar functions that operate on an intermediate storage. πŸ’…

the current width/height and initial width/height get set to objw and objh. the range for r, g, b is unsigned 8-bit (0..255), and the optional storew and storeh arguments define the actual storage dimensions. slay. ✨

🧚 NOTES 🧚

  1. storew and storeh are subject to the limit of MAX_SURFACEW and MAX_SURFACEH. these are compile-time constants, and attempting to exceed these values is a terminal state transition πŸ˜­πŸ’€ β€” like, do not.
  2. objw and objh are expected to be > 0. setting these to an invalid value, i.e. <= 0, is a terminal state transition. fr fr, that's bad news. 🫢

✨ EXAMPLE ✨

here's the cute lil example β€” copy it exactly, bestie:

function fill_surface0()
      a = fill_surface(32, 32, 255, 0, 0, 32, 64);
      b = fill_surface( 1, 1, 0, 0, 0);
      c = fill_surface( 1, 1, 0, 0, 0, 32);
end

πŸ’€ MISUSE πŸ’€ β€” round one

do NOT do this one, bestie:

function fill_surface0()
      a = fill_surface(-1, 32, 255, 0, 0);
end

πŸ’€ MISUSE πŸ’€ β€” round two

and definitely do NOT do this either β€” look at those 65535s πŸ’€:

function fill_surface1()
      a = fill_surface(32, 32, 0, 0, 0, 65535, 65535);
end

πŸ‘€ SEE ALSO πŸ‘€

πŸ’– anyway, that's the whole page β€” source/version image, dated October 2026. mwah, go slay your video objects, bestie 🫢✨

πŸ“¦ where this page comes from