extimer(3alleg4)
β¨ extimer β using the timer (delays and interrupts) β¨
okay bestie, so this is extimer, and it lives in the Allegro manual β specifically the Allegro game programming library, section 3alleg4. it's a whole demo page, iykyk. π
πΈ SYNOPSIS πΈ
#include <allegro.h>
Example extimer
π DESCRIPTION π
so this program is literally here to show you how to use the timer routines, and ngl, they can be a bit of a pain π β because you have to be sure you lock all the memory that's used inside your interrupt handlers. no exceptions. lock it all. periodt.
The first part of the example shows a basic use of timing using the blocking function rest(). simple. iconic. blocking, but make it β¨intentionalβ¨.
The second part? that's where it gets spicy π₯ β it shows how to use three timers with different frequencies in a non blocking way. main character energy, fr fr.
lowkey the memory-locking thing is the part that bites people, so if your interrupt handler touches a variable, bestie, it needs to be locked. do not skip that step. π
π SEE ALSO π
END_OF_FUNCTION(3alleg4)END_OF_MAIN(3alleg4)LOCK_FUNCTION(3alleg4)LOCK_VARIABLE(3alleg4)SCREEN_W(3alleg4)allegro_error(3alleg4)allegro_init(3alleg4)allegro_message(3alleg4)clear_to_color(3alleg4)desktop_palette(3alleg4)font(3alleg4)install_int(3alleg4)install_int_ex(3alleg4)install_keyboard(3alleg4)install_timer(3alleg4)key(3alleg4)keypressed(3alleg4)makecol(3alleg4)readkey(3alleg4)rest(3alleg4)screen(3alleg4)set_gfx_mode(3alleg4)set_palette(3alleg4)textprintf_centre_ex(3alleg4)
and that's the whole vibe!! π¦ this page is from Allegro, version 4.4.3 β so like, shoutout to the Allegro era for real, this is extimer(3alleg4) signing off. go lock your variables bestie, ily π«Άπ
π¦ 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