al_draw_pixel(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

✨ al_draw_pixel(3) ✨

okay bestie, so this one is from the Allegro 5 API reference manual and she is literally the tiniest little drawing function you ever met πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

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

no cap, that's the whole signature πŸ’…


πŸ’– DESCRIPTION πŸ’–

So al_draw_pixel draws a single pixel at x, y. one (1) pixel. that's her whole job and she does it 🫢

but here's the tea, because this function is lowkey the main character of the pixel-drawing trio:

  • unlike al_put_pixel(3), it does blending ✨
  • and unlike al_put_blended_pixel(3), it respects the transformations β€” meaning the pixel's position is transformed, but its size is unaffected, so it stays a pixel, periodt πŸ’€
⚠️ heads up bestie: this function can be slow if called often. like, if you're out here calling it in a loop a thousand times, that's giving performance disaster 😭 if you need to draw a lot of pixels, consider using al_draw_prim(3) with ALLEGRO_PRIM_POINT_LIST from the primitives addon instead. slay πŸ”₯

and here's what the args mean:

  • x β€” destination x πŸ“
  • y β€” destination y πŸ“
  • color β€” color of the pixel 🌈
πŸ™ˆ note: this function may not draw exactly where you expect it to. i know. i know. see the pixel-precise output section on the primitives addon documentation for the details on how to control exactly where the pixel is drawn πŸ‘‘

πŸ¦‹ SEE ALSO πŸ¦‹


that's the whole page bestie, go forth and place your single pixel with confidence πŸ’œβœ¨

sign-off: this was the Allegro reference manual, brought to you by al_draw_pixel(3) β€” ily, bye πŸŽ€πŸŒŸ

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms