al_set_new_di...y_refresh_rate(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 πŸ‘€


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