SDL_HINT_VID...BLE_XSYNC_EXT(3)

πŸ“¦
version 3.4.18 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT πŸ’–

okay bestie, pull up a chair, we're reading a page from the SDL3 FUNCTIONS manual β€” it's SDL_HINT_VID...BLE_XSYNC_EXT(3) and it's lowkey iconic for one very specific reason. let's get into it πŸ¦‹


✨ NAME ✨

SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT β€” a variable controlling whether the X Synchronization Extension is enabled. that's it, that's the whole vibe check πŸ‘‘


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT "SDL_VIDEO_X11_ENABLE_XSYNC_EXT"

like, that's the include, that's the define, copy it exactly bestie, character for character, no cap πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea: if you set this hint, you can get smoother window resizing when you're rendering with OpenGL. slay. BUT. and this is a big but πŸ‘

there are some conditions, and she is not flexible about them:

  • It is only activated on windows created with the SDL_WINDOW_OPENGL flag. (and windows using an SDL OpenGL renderer have this automatically set, so those girlies are already covered 🫢)
  • When it's activated, presentation must be done with SDL_GL_SwapWindow()

(SDL_RenderPresent() calls this internally for OpenGL renderers as well, so you're fine there too.)

⚠️ warning bestie, listen to me: enabling this and presenting via an external mechanism will result in sync requests not being acked, and hangs and other odd window behavior may result. not cute. not the moment. πŸ’€

The variable can be set to the following values:

  • "0": The X Synchronization Extension is disabled. (default)
  • "1": The X Synchronization Extension is enabled.

and the timing?? this hint should be set before creating a window. before. like, ahead of time. not after. she needs to know in advance, she's a planner πŸ’…


🌈 AVAILABILITY 🌈

This hint is available since SDL 3.4.10. yes, that's a real version, she's been around, she's established ⭐


and that's the whole page, no notes, go forth and resize smoothly πŸ¦‹βœ¨

Simple Directmedia Layer β€” SDL 3.4.18 β€” SDL_HINT_VID...BLE_XSYNC_EXT(3), mwah, that's the sign-off, love u, bye πŸ‘‘πŸ’–

πŸ“¦ where this page comes from