al_draw_pixel(3alleg5)

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

πŸ’– NAME πŸ’–

ok so bestie, welcome to the Allegro reference manual page for al_draw_pixel β€” yes it's Allegro 5 API, we love a glow-up era ✨


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

void al_draw_pixel(float x, float y, ALLEGRO_COLOR color)

πŸŽ€ DESCRIPTION πŸŽ€

Okay so real talk: this function draws a single pixel at x, y. That's it. That's the whole job. But she's got range, so listen up πŸ‘‘

The way that she's built different from al_put_pixel(3alleg5)? She does blending. Periodt. And the way she differs from al_put_blended_pixel(3alleg5)? She respects the transformations β€” meaning the pixel's position gets transformed, but its size is unaffected, so it stays exactly one pixel, no stretching, no nothing. Iconic behavior, no cap πŸ’…

lowkey a warning though: this function can be slow if called often. Not her fault, she's just doing a lot per call. So if you need to draw a LOT of pixels, don't spam her β€” consider using al_draw_prim(3alleg5) with ALLEGRO_PRIM_POINT_LIST from the primitives addon instead. She'll understand 🫢

Here's the full tea on her arguments:

  • x β€” destination x πŸ“
  • y β€” destination y πŸ“
  • color β€” color of the pixel 🎨
    • Note: this function may not draw exactly where you expect it to. Fr fr. See the pixel-precise output section on the primitives addon documentation for the details on how to control exactly where the pixel is drawn. iykyk 🌈

πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the whole page bestie, thanks for coming to my ted talk πŸ’œ and shoutout to the Allegro reference manual for the version, plus the al_draw_pixel(3alleg5) crew β€” stay pixelated, stay blessed πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from