al_put_pixel(3alleg5)

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

✨ al_put_pixel ✨

okay bestie, so this is a page from the Allegro 5 reference manual (3alleg5, if we're being official about it) and it's literally about painting ONE single pixel πŸ’…


🌸 NAME 🌸

al_put_pixel β€” the Allegro 5 API function that puts a pixel. that's it. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro5/allegro.h>

void al_put_pixel(int x, int y, ALLEGRO_COLOR color)

like. three little arguments. a coordinate and a color. iconic behavior fr fr. ✨


πŸ’– DESCRIPTION πŸ’–

so what does it do? it draws a single pixel on the target bitmap. one. pixel. no cap. 🫢

now here's the tea though, and I need you to hear me on this one: this operation is slow on non-memory bitmaps. like, it's giving "why is my frame rate crying" energy. 😭

so if you're gonna call this thing multiple times on the same bitmap, bestie, please β€” consider locking the bitmap. that's what al_lock_bitmap is for. do it. your performance will thank you. πŸ™ˆ

and one more thing, super important, don't skip this: this function is not affected by the transformations or the color blenders. so whatever fancy rotation or blending you've got going on elsewhere? yeah, this pixel does not care. it shows up raw and unbothered. main character energy honestly. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're all part of the same little pixel-putting family. πŸ’œ


and that's the page!! this was pulled from the Allegro reference manual, version/source al_put_pixel(3alleg5), dated al_put_pixel(3alleg5) (yes the footer is just the same name twice, we love a self-referential moment πŸ“). anyway mwah, go draw some pixels, slay, periodt. πŸ’–βœ¨πŸ§šπŸŒˆβ­

πŸ“¦ where this page comes from