al_get_backbuffer(3alleg5)

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

✨ al_get_backbuffer β€” Allegro 5 API ✨

okay bestie, gather round, we're talking about al_get_backbuffer from the Allegro 5 API πŸ’– this is a manual page, it's giving very "read me before you break me", and honestly? iconic.


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

ALLEGRO_BITMAP *al_get_backbuffer(ALLEGRO_DISPLAY *display)

like, that's the whole signature. short. sweet. main character energy πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So this function returns a special bitmap that represents the back-buffer of the display. yes, the back-buffer. THE one. πŸ‘‘

But listen, bestie, care should be taken when you're using the backbuffer bitmap (and its sub-bitmaps too, don't forget those) as the source bitmap β€” like, for example, as the bitmap argument to al_draw_bitmap(3alleg5). 🫢

Here's the tea, fr fr:

  • Only untransformed operations are hardware accelerated.
  • Which operations are those exactly? These consist of al_draw_bitmap(3alleg5) and al_draw_bitmap_region(3alleg5) β€” but only when the current transformation is the identity. no cap.
  • If the transformation is not the identity, or if some other drawing operation is used, then the call will be routed through the memory bitmap routines... which are slow. 😭 like, painfully slow. the vibe check fails.
so if you need those operations to be accelerated, here's the move: first copy a region of the backbuffer into a temporary bitmap (via the al_draw_bitmap(3alleg5) and al_draw_bitmap_region(3alleg5)), and then use that temporary bitmap as the source bitmap. slay. problem solved. ✨

πŸŽ€ SEE ALSO πŸŽ€

okay technically this page didn't hand me a SEE ALSO list, but the girls it keeps shouting out are al_draw_bitmap(3alleg5) and al_draw_bitmap_region(3alleg5), so go read those next, iykyk 🧚


and that's the whole page, bestie πŸ’œ this was the Allegro reference manual, al_get_backbuffer(3alleg5) β€” no date on this one, just vibes and version energy. stay accelerated, stay iconic, periodt. 🌈⭐

πŸ“¦ where this page comes from