fill_surface(3)
π 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 π§
storewandstorehare subject to the limit ofMAX_SURFACEWandMAX_SURFACEH. these are compile-time constants, and attempting to exceed these values is a terminal state transition ππ β like, do not.objwandobjhare 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
- 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