current_context_usage(3)

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

πŸŽ€ current_context_usage πŸŽ€

okay so bestie, this page is from the Arcan Lua API manual, and the main character is current_context_usage. πŸ’…

✨ NAME ✨

current_context_usage β€” return how many cells the current context has, and how many of those cells are currently unused. 🫢

πŸ¦‹ SYNOPSIS πŸ¦‹

       total, used
       current_context_usage()

πŸ’– DESCRIPTION πŸ’–

So this function sweeps the VID pool of the currently active context and counts β€” that’s O(n), no cap β€” how many of those are in use. Then it returns how many slots are available in total, and how many are maked as used. Yes, β€œmaked” β€” we keep the original typo energy, it’s iconic. 😭

The number of free slots can be found by subtracting used from total. Math ate, fr fr. πŸ”₯

🌸 EXAMPLE 🌸

Peep the example β€” it fills a surface, prints the usage, fills another surface, and prints the usage again:

       function current_context_usage0()
             a = fill_surface(32, 32, 0, 0, 0);
             print(current_context_usage());
             b = fill_surface(32, 32, 0, 0, 0);
             print(current_context_usage());
       end

mwah πŸ’‹ β€” this cute little page comes from source/version vidsys, dated October 2026. 🌈

πŸ“¦ where this page comes from