al_flip_display(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’– NAME πŸ’–

al_flip_display β€” Allegro 5 API. This is the al_flip_display(3) page from the Library Functions Manual, and bestie, she's iconic for getting your graphics onto the screen βœ¨πŸ’…

✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

void al_flip_display(void)

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so what she does: she copies or updates the front and back buffers so that what has been drawn previously on the currently selected display becomes visible on screen. That's literally her whole main-character job πŸ’–

Pointers to the special back buffer bitmap remain valid and retain their semantics as the back buffer, although the contents may have changed. So don't panic, bestie β€” the pointer is still valid, even if the pixels said "new phone who dis" πŸ‘‘

Note: if you are not using the ALLEGRO_SINGLE_BUFFER option, you typically want to redraw every pixel of the backbuffer bitmap to avoid uninitialized memory artifacts. fr fr, don't leave uninitialized memory crumbs πŸ“

Several display options change how this function behaves:

  • With ALLEGRO_SINGLE_BUFFER, no flipping is done. You still have to call this function to display graphics, depending on how the used graphics system works. lowkey weird but that's the vibe ✨
  • The ALLEGRO_SWAP_METHOD option may have additional information about what kind of operation is used internally to flip the front and back buffers. iykyk πŸ”
  • If ALLEGRO_VSYNC is 1, this function will force waiting for vsync. If ALLEGRO_VSYNC is 2, this function will not wait for vsync. With many drivers the vsync behavior is controlled by the user and not the application, and ALLEGRO_VSYNC will not be set; in this case al_flip_display(3) will wait for vsync depending on the settings set in the system's graphics preferences. so yeah, vsync said "it's complicated" 😭

🌈 SEE ALSO 🌈


source/version: Allegro reference manual Β· date: not listed, bestie πŸ«ΆπŸŽ€

πŸ’œ that's the page, slay πŸ’œ

πŸ“¦ 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