al_set_new_bitmap_samples(3alleg5)
π al_set_new_bitmap_samples π
okay bestie, so this one is from the Allegro 5 API β like, the whole manual, the allegro5 set, and this page is specifically about al_set_new_bitmap_samples. yes it's a mouthful. we love her anyway. π«Ά
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
void al_set_new_bitmap_samples(int samples)
πΈ DESCRIPTION πΈ
so this function sets the multi-sampling samples that brand-new bitmaps use β and important detail, it's on the current thread only, bestie. and this matters if those bitmaps get used with al_set_target_bitmap(3alleg5). okay? okay. π
let's talk numbers, because numbers are the whole vibe here:
0β multi-sampling is not used when you're drawing into the bitmap. this is the default. yes, the default is zero. she's lowkey shy.1β multi-sampling is used, but only with a single sample per pixel. so basically there's usually no visual difference from not using multi-sampling at all. it's giving "I did the thing but the thing changed nothing" π
Note: some platforms have restrictions on when the multi-sampling buffer for a bitmap is realized β meaning down-scaled back to the actual bitmap dimensions. this may only happen after a call to al_set_target_bitmap(3alleg5). so like, for example:
al_set_target_bitmap(multisample);
al_clear_to_color(blue);
al_draw_line(0, 0, 100, 100, red, 1);
al_lock_bitmap(multisample, ...)
// ERROR: the contents of the bitmap will be undefined
al_set_target_bitmap(backbuffer);
al_lock_bitmap(multisample, ...)
// CORRECT: at this point, the bitmap contents are updated and
// there will be an anti-aliased line in it.
so the first one? undefined contents. not a vibe. the second one? anti-aliased line, correct contents, main character behavior. π
β SINCE β
5.2.1 β periodt.
[Unstable API]: this is an experimental feature and currently only works for the OpenGL backend. so if you're on some other backend, bestie, this is not your moment yet. π
and that's the whole page!! this was the Allegro reference manual, 3alleg5 edition β the footer had no date on it, which is very mysterious of her, but the source and version are al_set_new_bitmap_samples(3alleg5) from the Allegro reference manual. slay, stay multi-sampled, mwah πβ¨π
π¦ where this page comes from
- 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