al_clear_depth_buffer(3alleg5)
π al_clear_depth_buffer β the Allegro 5 API page, bestie edition π
okay so this is al_clear_depth_buffer from the Allegro 5 API, manual section 3alleg5 if you're keeping score. it's giving "tiny function, big responsibility." let's get into it π«Ά
β¨ NAME β¨
al_clear_depth_buffer β Allegro 5 API
that's it. that's the name. short, sweet, iconic.
π SYNOPSIS π
#include <allegro5/allegro.h>
void al_clear_depth_buffer(float z)
so you include the big one, <allegro5/allegro.h>, and then you've got void al_clear_depth_buffer(float z) β returns nothing, takes one float z, no drama. π
πΈ DESCRIPTION πΈ
okay so what does it do? it clears the depth buffer, and it's confined by the clipping rectangle, and it sets it to the value you pass in. that's the whole vibe.
bestie. listen. π¨ a depth buffer only exists if you actually asked for it β you gotta request it withal_set_new_display_option(3alleg5)and the requirement has to have actually been met by theal_create_display(3alleg5)call that created your current display. if either of those didn't happen, no depth buffer for you, no cap. π
also, anything touching the depth buffer is affected by al_set_render_state(3alleg5) β so don't forget that knob exists.
for example (and this one is genuinely useful, not me just talking): if ALLEGRO_DEPTH_FUNCTION is set to ALLEGRO_RENDER_LESS, then a depth buffer value of 1 represents infinite distance. so like, 1 is a good value to use when you're clearing the depth buffer. queen behavior. π
β SINCE β
5.1.2 β been here since 5.1.2, a real veteran π
π¦ SEE ALSO π¦
al_clear_to_color(3alleg5)al_set_clipping_rectangle(3alleg5)al_set_render_state(3alleg5)al_set_new_display_option(3alleg5)
go read those too, they're all in the friend group π«Ά
and that's the page!! brought to you by the Allegro reference manual, section al_clear_depth_buffer(3alleg5) β mwah, go clear some buffers, bestie πβ¨π
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms