install_int(3alleg4)

πŸ’– install_int β€” bestie's guide to timers πŸ’–

okay so you're out here in the Allegro game programming library and you want a thing to happen over and over, on a schedule, like clockwork? say less. this is the 3alleg4 page for install_int, and it's giving main character energy ✨


🌸 SYNOPSIS 🌸

#include <allegro.h>

int install_int(void (*proc)(), int speed);

πŸŽ€ DESCRIPTION πŸŽ€

So basically, install_int installs a user timer handler, and speed is the number of milliseconds between ticks. That's it, that's the vibe πŸ¦‹

Lowkey the important thing to know is this is the exact same thing as:

install_int_ex(proc, MSEC_TO_TIMER(speed))

fr fr, same energy, just a glowier wrapper.

Also, not me forgetting to set up the timer module first β€” because if you call this routine without having installed the timer module yet, install_timer() gets called automatically for you. considerate king behavior honestly πŸ‘‘

And here's the cute part: if you call this routine again with the same timer handler as the parameter, you can adjust its speed. like, same bestie, new tempo. periodt πŸ’…


⭐ RETURN VALUE ⭐

  • Returns zero on success 🫢
  • Returns a negative number if there is no room to add a new user timer 😭

πŸ’œ SEE ALSO πŸ’œ


okay that's the whole page, you ate it, no crumbs 🌈

this little love letter was brought to you by Allegro, version 4.4.3, and it's install_int(3alleg4) β€” go forth and tick, bestie πŸ’–πŸŽ€πŸŒΈ