putpixel(3alleg4)
β¨ putpixel β writes a pixel into a bitmap β¨
okay bestie, so this is the Allegro game programming library manual, and today we're talking about putpixel(3alleg4) π
the little function that literally puts one single pixel on your screen and honestly? iconic. every gorgeous sprite you've ever seen started as somebody putting down pixels one at a time. no cap. π
π NAME π
putpixel β writes a pixel into a bitmap. part of the Allegro game programming library. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
#include <allegro.h>
void putpixel(BITMAP *bmp, int x, int y, int color);
look at her. four arguments. no drama. she ate and left zero crumbs. β¨
π«Ά DESCRIPTION π«Ά
okay so here's the tea π β putpixel writes a pixel to the specified position in the bitmap, and the way it does that is by using the current drawing mode and the bitmap's clipping rectangle. so like, it's not just blindly slapping a color down wherever, bestie, it's respecting the drawing mode you've set and it's staying inside the clip rect. main character behaviour honestly. π
here's a little example so you can see her in action:
putpixel(screen, 10, 30, some_color);
that's it. that's the whole flex. one pixel, one position, one color, and suddenly you're a graphics programmer. ππ₯
ngl, if you're looping this over a whole image you're gonna want to peek at the SEE ALSO section below, because there are other pixel-poking friends in this library and they all have their own energy. π
π SEE ALSO π
the whole squad, fr fr β go check them out:
getpixel(3alleg4)β the read to this write, they're a matched set π_putpixel(3alleg4)β the underscore version, iykykdrawing_mode(3alleg4)β sets the vibe thatputpixelrespectsmakecol(3alleg4)β how you get acolorvalue in the first placeex12bit(3alleg4)exalpha(3alleg4)exflame(3alleg4)exjoy(3alleg4)exstars(3alleg4)exswitch(3alleg4)
and that's the page, bestie!! this was Allegro, version 4.4.3, and the date on this whole thing is putpixel(3alleg4) era β yeah the footer just says the manual name and version and that's so real of it. go put some pixels down, you're doing amazing. mwah. πβ¨ππ¦πΈπ
π«Ά
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms