glutSwapInterval(3)

✨ glutSwapInterval β€” freeglut's lil v-sync controller ✨

okay bestie, this is a freeglut page, manual section 3, and it's literally all about controlling how buffer swaps sync up with your display (aka v-sync). yes it's one function. yes it's short. but the vibes are immaculate and the details MATTER, so let's go πŸ’…


🌸 SYNOPSIS 🌸

void glutSwapInterval(int interval);

one function, one argument, infinite power 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • interval β€” the number of vertical blanking periods you wanna wait for before swapping. that's it. that's the whole input. how many v-blanks, bestie?

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜•

An interval of 0 requests no synchronization. buffers should be swapped immediately β€” even if the display device is in the middle of scanning out the previous frame. and what does that get you? visible artifacts, aka tearing 😭. it's giving chaos. it's giving unfiltered.

An interval of 1 is the standard v-sync setting. the swap happens during the next vertical blanking period, right after the current frame is done being scanned out to the display. classic. reliable. main character energy πŸ‘‘

Any other positive interval greater than 1 will wait for that many v-blank periods before swapping. so like, you said 3? bestie you're waiting 3. no notes.

Negative interval values are for "adaptive v-sync". here's how that works:

  • If drawing is completed and the swap is ready to be executed before the target v-blank, the swap will be performed at the target v-blank, exactly as if the interval was positive.
  • If the target interval has elapsed and the swap is running late, instead of waiting more, the swap will be performed immediately, unsynchronized with the display.

late swap? no waiting. just vibes. πŸ¦‹

⚠️ real talk though: not all GL implementations support all of these semantics. Freeglut will attempt to fall-back to the nearest-equivalent supported swap interval. specifically:
  • If adaptive v-sync is not supported, negative values will be flipped to their positive equivalent.
  • If running unsynchronized is not possible, an interval of 1 will be used instead.

so your fancy negative numbers might just get absolutified. the fallback is fallbacking πŸ™ˆ


🧚 SEE ALSO 🧚

  • glutSwapBuffers

πŸ’œ AUTHOR πŸ’œ

John Tsiombikas β€” nuclear@mutantstargoat.com


and that's the whole page, bestie!! ✨ this freeglut drop is dated October 2025, and the manual name on the tin is glutSwapInterval(3) β€” freeglut version, October 2025, periodt πŸ’…πŸŽ€πŸŒˆ