SDL_HINT_MAIN_CALLBACK_RATE(3)
β¨ NAME β¨
SDL_HINT_MAIN_CALLBACK_RATE β bestie, this is the hint that tells SDL how often to call SDL_AppIterate(). Like, you get to pick the rate. Iconic. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_hints.h>
#define SDL_HINT_MAIN_CALLBACK_RATE "SDL_MAIN_CALLBACK_RATE"
π¦ DESCRIPTION π¦
okay so here's the tea π β if you set this hint to a number, that number means Hz. So "60" means "pls try to iterate 60 times per second", no cap.
"0" means go absolutely feral β iterate as fast as possible. main character energy fr.
β οΈ Negative values are illegal, but they're reserved, just in case they turn out to be useful in some future revision of SDL. So don't touch them, bestie, they're not for you (yet). π
There are also some strings with special meaning, because of course there are. If you set it to "waitevent", then SDL_AppIterate will not be called until new event(s) have arrived β and been processed by SDL_AppEvent. The way that this is literally perfect for apps that are completely idle except in response to input ππ
On some platforms β or if you're using SDL_main instead of SDL_AppIterate β this hint is just... ignored. Nothing you can do, it's giving "we don't serve your kind here". But when the hint can be used, it's allowed to be changed at any time. Anytime. Girlboss flexibility. β¨
This defaults to 0, and specifying NULL for the hint's value will restore the default. Reset button, slay.
And here's the part that ate: this doesn't have to be an integer value. For example, "59.94" won't get rounded to an integer rate β the digits after the decimal are actually respected. Not me being obsessed with precision π
This hint can be set anytime. π«Ά
π AVAILABILITY π
This hint has been available since SDL 3.2.0. So if you're on anything older... no it isn't, babes. π
and that's the whole vibe check, bestie π this page came to you courtesy of Simple Directmedia Layer, version SDL 3.4.18 β SDL_HINT_MAIN_CALLBACK_RATE(3), periodt. β¨π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms