SDL_HINT_VID...SIZE_DRAWABLE(3)

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

πŸ’… NAME πŸ’…

SDL_HINT_VIDEO_METAL_AUTO_RESIZE_DRAWABLE β€” bestie, it's a variable that says whether the metal layer drawable size should get updated for the SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED event on macOS. That's the whole vibe. ✨


πŸŽ€ SYNOPSIS πŸŽ€

okay so first you gotta bring it in:

#include <SDL3/SDL_hints.h>

#define SDL_HINT_VIDEO_METAL_AUTO_RESIZE_DRAWABLE "SDL_VIDEO_METAL_AUTO_RESIZE_DRAWABLE"

literally just a #define, nothing scary, she's lowkey iconic for that. πŸ¦‹


🌸 DESCRIPTION 🌸

so this variable can be set to these values, and the way that you pick one matters:

  • "0" β€” the metal layer drawable size will not be updated on the SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED event. she's giving "I'll handle it myself, thanks." πŸ’…
  • "1" β€” the metal layer drawable size will be updated on the SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED event. this one is the default, so if you do nothing at all, you already get this. main character energy fr fr. πŸ‘‘
🫢 heads up bestie: this hint should be set before SDL_Metal_CreateView called. not after, not during, before. the order is not optional, I don't make the rules, SDL does. 😭

⭐ AVAILABILITY ⭐

this hint is available since SDL 3.4.0. if your SDL is older than that, she simply does not exist yet, no cap. πŸ™ˆ


and that's the whole page, babe β€” straight out of the Simple Directmedia Layer docs, SDL 3.4.18 era, so go forth and resize those drawables responsibly. mwah, ily, bye. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from