ALLEGRO_RENDER_STATE(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay bestie, so this is ALLEGRO_RENDER_STATE β€” it's part of the Allegro 5 API and it's literally the master list of render states you can flip on and off. we're talking glow-up settings for your pixels fr fr. πŸŽ€


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

typedef enum ALLEGRO_RENDER_STATE {

πŸ¦‹ DESCRIPTION πŸ¦‹

so these are the possible render states, and the way you set them is with al_set_render_state(3alleg5). that's the function, these are the vibes it accepts. let's go one by one, no skipping, i'm not about to leave you hanging πŸ’…

  • ALLEGRO_ALPHA_TEST β€” set this to 1 and it's giving bouncer at the club: the values of ALLEGRO_ALPHA_FUNCTION and ALLEGRO_ALPHA_TEST_VALUE together define a comparison function that gets run on the alpha component of every single pixel. only if that comparison evaluates to true does the pixel actually get written. if it's false? nope, no subsequent processing happens at all β€” not depth test, not blending, nothing. and honestly this is so useful, like for example if you're using a depth buffer but you do not want fully transparent pixels to be out there modifying it. main character boundary-setting energy. πŸ‘‘
  • ALLEGRO_ALPHA_FUNCTION β€” one of ALLEGRO_RENDER_FUNCTION(3alleg5), and it's only used when ALLEGRO_ALPHA_TEST is 1. it's the plus-one that only shows up if the main invite is accepted, iykyk.
  • ALLEGRO_ALPHA_TEST_VALUE β€” only used when ALLEGRO_ALPHA_TEST is 1. should be a value of 0 - 255. that's the range, don't be out here being extra with it.
  • ALLEGRO_WRITE_MASK β€” this one decides how the framebuffer and depthbuffer get updated whenever a pixel is written. and to be specific: in case alpha and/or depth testing is enabled, this happens after all such enabled tests succeed. also important β€” depth values are only written if ALLEGRO_DEPTH_TEST is 1, in addition to the write mask flag being set. both. not one or the other. both. πŸ”₯
  • ALLEGRO_DEPTH_TEST β€” set this to 1 and it compares the depth value of any newly written pixels with the depth value already in the buffer, according to ALLEGRO_DEPTH_FUNCTION. and heads up bestie: Allegro primitives with no explicit z coordinate will write a value of 0 into the depth buffer. that's just what they do. 🫢
  • ALLEGRO_DEPTH_FUNCTION β€” one of ALLEGRO_RENDER_FUNCTION(3alleg5), and it's only used when ALLEGRO_DEPTH_TEST is 1. again, conditional queen. only relevant when its bestie is on.

🌸 SINCE 🌸

5.1.2 β€” she's been around, she's iconic, she's established. ⭐


πŸ’œ SEE ALSO πŸ’œ

go read those too, they're all in the same friend group, you'll get the whole picture 🧚


and that's the whole page, bestie!! this came straight out of the Allegro reference manual, page ALLEGRO_RENDER_STATE(3alleg5) β€” sending you so much love, now go set some render states and slay πŸŒˆπŸ’–βœ¨

πŸ“¦ where this page comes from