set_displ...h_callback(3alleg4)
π set_display_switch_callback π
okay bestie, welcome to the Allegro manual β yes, the actual Allegro game programming library, and yes, we're about to make callback registration feel like a group chat notification. π¦
β¨ NAME β¨
set_display_switch_callback β installs a switching notification callback. Allegro game programming library.
πΈ SYNOPSIS πΈ
#include <allegro.h>
int set_display_switch_callback(int dir, void (*cb)());
π DESCRIPTION π
So here's the vibe: this function installs a notification callback for whichever switching mode you already picked out earlier by calling set_display_switch_mode(). It's literally the "hey bestie, text me when this happens" of display switching. π
The dir parameter is giving two whole options: it can be either SWITCH_IN or SWITCH_OUT, depending on whether you want to be notified about switches away from your program or back to your program. Pick your fighter. π
Sometimes you can lowkey install callbacks for both directions at the same time, but ngl β not every platform supports this, so don't come for me if it ghosts you. π
You can install several switch callbacks, but no more than eight on any platform. Eight. That's the cap, periodt. π«
β RETURN VALUE β
- Returns zero on success, decreasing the number of empty callback slots by one. (Slay, a slot got filled. π)
- Returns
-1if the request is impossible for the current platform, or if you've already reached the maximum number of allowed callbacks. π
π SEE ALSO π
and that's the whole page, bestie!! π«Ά this was brought to you by the Allegro manual, version 4.4.3 β go forth and register those callbacks, but remember, eight is the limit and the platform is always the main character deciding what's possible. no cap. πβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms