al_draw_pixel(3)
β¨ 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 usingal_draw_prim(3)withALLEGRO_PRIM_POINT_LISTfrom 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