_putpixel(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ _putpixel πŸ’… (Allegro manual, bestie)

okay so we're in the Allegro game programming library, and this is the speedrun version of putpixel(). πŸƒβ™€οΈπŸ’¨


πŸŽ€ NAME πŸŽ€

_putpixel, _putpixel15, _putpixel16, _putpixel24, _putpixel32 β€” the faster, depth-specific versions of putpixel(). Allegro game programming library, periodt. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <allegro.h>

void _putpixel(BITMAP *bmp, int x, int y, int color);

void _putpixel15(BITMAP *bmp, int x, int y, int color);

void _putpixel16(BITMAP *bmp, int x, int y, int color);

void _putpixel24(BITMAP *bmp, int x, int y, int color);

void _putpixel32(BITMAP *bmp, int x, int y, int color);

πŸ’– DESCRIPTION πŸ’–

so like, it's putpixel() but much faster ✨ and the reason is genuinely iconic: these are implemented as inline assembler functions written for specific color depths. that's the whole glow-up. πŸ’…

but bestie, listen, there are three things you need to know before you go feral with these:

  • they won't work in mode-X graphics modes πŸ’€
  • they don't perform any clipping β€” and no cap, they will crash if you try to draw outside the bitmap! 😭 so vibe check your coordinates, fr fr
  • they ignore the drawing mode πŸ™ˆ
use these when you already know exactly what you're doing and you need that speed. otherwise the regular putpixel() is right there. 🫢

πŸ¦‹ SEE ALSO πŸ¦‹


that's the whole page, bestie! 🌈 this one's from the Allegro manual, version 4.4.3 β€” _putpixel(3), slay, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from