pods::...amerate(3pm)

✨ NAME ✨

SDL::GFX::Framerate β€” framerate calculating functions 🎬⏱️

(this is the pods::...amerate(3pm) page btw, from the User Contributed Perl Documentation β€” hi bestie, you found it πŸ’–)

πŸŽ€ CATEGORY πŸŽ€

GFX ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the framerate functions are literally the chill pill of your graphics loop πŸ’Šβœ¨ β€” you use them to insert delays into the graphics loop so your framerate stays, like, constant. no cap. steady vibes only 🧚

πŸ‘‘ METHODS πŸ‘‘

🌸 init 🌸

use SDL;
use SDL::GFX::Framerate;
use SDL::GFX::FPSManager;

my $fps = SDL::GFX::FPSManager->new(0, 0, 0, 0);

SDL::GFX::Framerate::init($fps);

Initializes the framerate manager, sets the default framerate to 30Hz and resets the delay interpolation. it's giving "fresh start, clean slate, main character energy" 😌🫢

πŸ’… set πŸ’…

SDL::GFX::Framerate::set($fps, 60);

Sets the new desired framerate to 60 frames per second. glow up your fps, periodt πŸ”₯

⭐ get ⭐

my $rate = SDL::GFX::Framerate::get($fps);

Gets the currently set framerate of the manager. just a lil vibe check on your fps πŸ‘€πŸ’–

🌈 delay 🌈

SDL::GFX::Framerate::delay($fps);

Generates a delay to accommodate the currently set framerate. call this once in the graphics/rendering loop πŸŒ€

heads up bestie: if the computer cannot keep up with the rate (i.e. drawing too slow 😭), the delay is zero and the delay interpolation is reset. so like, your machine's slowness = no delay, interpolation goes back to square one. facts are facts πŸ’€

🫢 AUTHORS 🫢

See "AUTHORS" in SDL. πŸ’œ


and that's the whole page, no gatekeeping πŸŽ€ this was perl v5.42.3, dated 2026-08-19, pls stan pods::...amerate(3pm) in the User Contributed Perl Documentation, mwah πŸ’‹βœ¨πŸ“

πŸ“¦ where this page comes from