request_refresh_rate(3)
π request_refresh_rate β the Allegro manual, but make it slay π
okay bestie, welcome to the Allegro manual π this one's called request_refresh_rate(3) and it's lowkey the girl who asks for what she wants before the party even starts. Allegro game programming library, periodt. β¨
β¨ NAME β¨
request_refresh_rate β requests a specific refresh rate during graphic mode switch. Allegro game programming library. π¦
πΈ SYNOPSIS πΈ
#include <allegro.h>
void request_refresh_rate(int rate);
π DESCRIPTION π
So here's the vibe: you call this and you're basically politely sliding a note across the table asking that the next call to set_gfx_mode() try to use the refresh rate you specified β if possible. That "if possible" is doing a LOT of work, bestie, so let me be fr fr: not all drivers are able to control this at all, and even the ones that can won't manage every rate on every piece of hardware. So the actual settings may differ from what you requested. π No cap. The hardware is the main character here, not you.
After you call set_gfx_mode(), you can use get_refresh_rate() to find out what was actually selected. Because requesting and receiving are two different things, iykyk. π
At the moment, only the DOS VESA 3.0, X DGA 2.0 and some Windows DirectX drivers support this function. That's the whole list. That's it. π«Ά
The speed is specified in Hz, eg. 60, 70. And if you want to return to the normal default selection, just pass a rate value of zero. β
Example, because seeing it hit different:
request_refresh_rate(60);
if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0)
abort_on_error("Couldn't set graphic mode!");
if (get_refresh_rate() != 60)
abort_on_error("Couldn't set refresh rate to 60Hz!");
Not me checking the refresh rate twice like a suspicious bestie. π That's literally the whole point though β ask, set, then verify. π₯
Heads up: since not all drivers and not all hardware can honour your request, don't assume get_refresh_rate() will hand you back the number you asked for. Always check. π
π SEE ALSO π
Allegro, version 4.4.3 β and that's the page, request_refresh_rate(3), wrapped up with a lil bow π ty for reading bestie, go forth and set those modes, mwah πβ¨π¦
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms