switch_default_texfilter(3)

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

πŸ’… switch_default_texfilter(3) β€” Arcan Lua API, bestie edition

okay so real talk, this one's from the Arcan Lua API manual and it's literally about setting the vibe for every texture you're about to make. slay.


✨ NAME ✨

switch_default_texfilter β€” switches the default texture filtering mode for all newly created objects. that's it, that's the girlboss job. no cap. πŸ‘‘


🌸 SYNOPSIS 🌸

nil
switch_default_texfilter( filtermode )

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function is lowkey a little picky about what you feed it β€” it accepts FILTER_NONE, FILTER_LINEAR, FILTER_BILINEAR and FILTER_TRILINEAR, which are texture post-processing stages usually supported in-hardware. iconic, right? πŸŽ€

the tea though: anything else would have to be implemented as temporary rendertargets with appropriate shaders. so like, the fancy options aren't just lying around for free β€” someone's gotta build them. iykyk πŸ’…


⭐ NOTES ⭐

  1. any value to filtermode outside the accepted values is a terminal state transition. (yes bestie, terminal. like that terminal. do not pass go, do not collect $200 πŸ™ˆπŸ’€)

🌈 EXAMPLE 🌈

function switch_default_texfilter0()
      switch_default_texfilter(FILTER_NONE);
      a = load_image("test.png");
      show_image(a);
      scale_image(a, 1.25, 1.25);
      switch default_texfilter(FILTER_TRILINEAR);
      b = load_image("test.png");
      show_image(b);
      scale_image(b, 1.25, 1.25);
      local props = image_surface_properties(a);
      move_image(b, 0, props.height);
end

look at her go β€” two images, two different filters, one stacked politely under the other. main character energy fr fr 🫢✨


πŸ’€ MISUSE πŸ’€

this one's the "none but as a string" moment. the audacity.

function switch_default_texfilter0()
      switch_default_texfilter("none");
end

πŸ”₯ MISUSE πŸ”₯

and this one's just out here sending 1000 into the void, as if that's a filter mode. ma'am.

function switch_default_texfilter1()
      switch_default_texfilter(1000);
end
⚠️ reminder bestie: those two? both are terminal state transitions. the NOTES section was not playing around. do not be like these functions. 🚨

🧚 SEE ALSO 🧚

(nothing else listed in this one β€” she stands alone, periodt πŸ’œ)


okay that's the whole page! this lil' gem comes courtesy of vidsys, dated October 2026 β€” mwah, thanks for the docs, and go filter some textures responsibly πŸ˜­πŸ’–βœ¨

πŸ“¦ where this page comes from