al_flip_display(3)
π 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_METHODoption may have additional information about what kind of operation is used internally to flip the front and back buffers. iykyk π - If
ALLEGRO_VSYNCis1, this function will force waiting for vsync. IfALLEGRO_VSYNCis2, this function will not wait for vsync. With many drivers the vsync behavior is controlled by the user and not the application, andALLEGRO_VSYNCwill not be set; in this caseal_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