image_sharestorage(3)
πΈ 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 π
- Texture coordinates are initially copied over but are otherwise managed separately in each object.
WORLDIDis a validsrcargument, (WORLDIDasdstis undefined) but any surface that shares storage withWORLDIDshould not be part of a visible rendertarget.- Video image post processing (
scale,flipsandfiltermode) are bound to the texture store and not to any single object. - Using a broken or empty
vstoreassrcwill convertdstinto the equivalent of anull_surface. Using a color surface will copy the colour values and the assigned shader. - Sharing into a
dstthat is also used as the storage for a rendertarget will invalidate the state of the rendertarget and an explicitrendertarget_forceupdatewill be called. - 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
preframestage β or the result of using avidthat shares backing store with a rendertarget will be undefined. π¨ undefined behavior is not the vibe, bestie. - 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 π
instance_image(3)null_surface(3)
π«Ά cute lil sign-off: this page is from the image manual, dated October 2026. mwah πβ¨
π¦ 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