al_set_new_di...y_refresh_rate(3alleg5)
π al_set_new_display_refresh_rate π
okay bestie, so this is a page straight out of the Allegro 5 API reference manual, and we're gonna talk about setting your display's refresh rate before you even make one. yes, before. it's giving "manifest it and it shall appear" energy β¨
πΈ NAME πΈ
al_set_new_display_refresh_rate β the Allegro 5 API function that tells future displays what refresh rate you want, no cap π
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
void al_set_new_display_refresh_rate(int refresh_rate)
that's it, that's the whole vibe π
π¦ DESCRIPTION π¦
so here's the tea, bestie: this function sets the refresh rate that gets used when you create new displays on the calling thread. like, you're setting the intention ahead of time so that when a display pops into existence, it already knows what you want. main character energy fr fr π
and here's the part where you gotta pay attention: if that refresh rate isn't actually available, then al_create_display(3alleg5) will fail. not "oh it'll fall back to something reasonable", not "it'll shrug and move on" β it will straight up fail π so pls, don't just pick a random number out of the void.
want to know which modes and refresh rates you actually have to work with? you can get the whole list with al_get_num_display_modes(3alleg5) and then peek at each one using al_get_display_mode(3alleg5). window shopping but make it display config ποΈ
the default setting is zero, which means "don't care" β the most unbothered, go-with-the-flow setting imaginable π
π SEE ALSO π
al_get_new_display_refresh_rate(3alleg5)β for when you wanna check what you set, iykyk
and that's the whole page, periodt π this came to you from the Allegro reference manual, page al_set_new_di...y_refresh_rate(3alleg5) β go forth and set your refresh rate responsibly, bestie π«ΆπΈ
π¦ 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