image_sharestorage(3)

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

🌸 image_sharestorage(3) β€” Arcan Lua API 🌸

okay so bestie, welcome to image_sharestorage(3) from the Arcan Lua API manual. We're making two VIDs share one texture store and it's giving linked-account energy. πŸ’… no cap.


πŸŽ€ NAME πŸŽ€

image_sharestorage β€” setup two VIDs to use the same texture store. periodt.

✨ SYNOPSIS ✨

bool
image_sharestorage( vid:src, vid:dst )

πŸ¦‹ DESCRIPTION πŸ¦‹

So a vid has a bunch of metadata states β€” such as position and orientation β€” plus this whole concept of a 'storage', which is the textual, image or external source tied to the vid. The point is to prevent multiple views of the same storage, and this function lets you share the storage of vid as the storage of dst. slay.

πŸ’– NOTES πŸ’–

  1. Texture coordinates are initially copied over but are otherwise managed separately in each object.
  2. WORLDID is a valid src argument, (WORLDID as dst is undefined) but any surface that shares storage with WORLDID should not be part of a visible rendertarget.
  3. Video image post processing (scale, flips and filtermode) are bound to the texture store and not to any single object.
  4. Using a broken or empty vstore as src will convert dst into the equivalent of a null_surface. Using a color surface will copy the colour values and the assigned shader.
  5. Sharing into a dst that is also used as the storage for a rendertarget will invalidate the state of the rendertarget and an explicit rendertarget_forceupdate will be called.
  6. There is no ordering imposed in rendertarget updates, which means that a store that is used as the destination for a rendertarget will need to have all dependent rendertargets manually updated in the preframe stage β€” or the result of using a vid that shares backing store with a rendertarget will be undefined. 🚨 undefined behavior is not the vibe, bestie.
  7. persistent objects and instances cannot be used as dst.

🌈 EXAMPLE 🌈

Here's the cute lil example, bestie:

       function image_sharestorage0()
             a = load_image("test.png");
             b = null_surface(64, 64);
             move_image(b, 100, 100);
             show_image({a, b});
             image_sharestorage(a, b);
       end

πŸ’€ MISUSE πŸ’€

First misuse β€” don't do this, okay? πŸ’€

       function image_sharestorage0()
             image_sharestorage(b, a);
       end

πŸ’€ MISUSE (pt. 2, electric boogaloo) πŸ’€

Another misuse, and yes it's still a no:

       function image_sharestorage1()
             persist_image(a);
             image_sharestorage(a, b);
       end

πŸ‘€ SEE ALSO πŸ‘€


🫢 cute lil sign-off: this page is from the image manual, dated October 2026. mwah πŸ’‹βœ¨
πŸ“¦ where this page comes from