ALLEGRO_STATE(3alleg5)
β¨ ALLEGRO_STATE β¨
okay bestie, welcome to the Allegro 5 API π this one's short but it's important, so lock in π«Ά
πΈ SYNOPSIS πΈ
typedef struct ALLEGRO_STATE ALLEGRO_STATE;
π DESCRIPTION π
So this is an opaque type, which is just a fancy way of saying "you don't get to peek inside, you just pass her around" π She gets handed off to al_store_state(3alleg5) and al_restore_state(3alleg5), and that's her whole job. Queen of minding her own business π
The various state that Allegro keeps internally can be displayed like this:
global
active system driver
current config
per thread
new bitmap params
new display params
active file interface
errno
current blending mode
current display
deferred drawing
current target bitmap
current transformation
current projection transformation
current clipping rectangle
bitmap locking
current shader
Look at that little family tree π³ iconic honestly.
ngl, here's the tea β: in general, the only real global state is the active system driver. Everything else global-ish is actually per-thread, which means if your app is running multiple separate threads, they literally never interfere with each other β¨ bestie behaviour fr fr.
β οΈ Caveat though, don't get too comfy: that's except if there are objects accessed by multiple threads, of course. Usually you wanna minimize that though β and for the remaining cases, use the synchronization primitives described in the threads section, or the events described in the events section, to control inter-thread communication π don't just yolo it.
Allegro reference manual Β· ALLEGRO_STATE(3alleg5) β mwah, that's the whole page, ily, go forth and store/restore your state responsibly ππ¦π
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms