al_draw_bitmap_region(3alleg5)

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

✨ NAME ✨

bestie, this is al_draw_bitmap_region β€” the Allegro 5 API function that lets you yeet just a lil piece of a bitmap onto the target bitmap πŸ’–


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

void al_draw_bitmap_region(ALLEGRO_BITMAP *bitmap,
   float sx, float sy, float sw, float sh, float dx, float dy, int flags)

πŸŽ€ DESCRIPTION πŸŽ€

okay so picture this: you have a whole bitmap, right, and you do NOT want the whole thing. you want a region of it. a lil cropped slice. the moment. and you want that slice drawn onto the target bitmap. that's literally what this does, no cap πŸ¦‹

here's the breakdown of every single argument, because we don't gatekeep:

  • sx β€” source x πŸ’…
  • sy β€” source y πŸ’…
  • sw β€” source width (aka how wide the region you're blitting is)
  • sh β€” source height (aka how tall the region you're blitting is)
  • dx β€” destination x
  • dy β€” destination y
  • flags β€” exactly the same as the ones for al_draw_bitmap(3alleg5), periodt
🌈 and fr fr, go read al_draw_bitmap(3alleg5) because it has a whole note about the restrictions on which bitmaps can be drawn where. that's not optional lore, that's required reading, bestie.

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, gorgeous πŸ’œ this came to you straight from the Allegro reference manual, and yeah, the page is literally named al_draw_bitmap_region(3alleg5) β€” she's iconic, she's the main character, she's done here πŸŽ€βœ¨

πŸ“¦ where this page comes from