SDL_HINT_REN..._POWER_DEVICE(3)

πŸ’– SDL_HINT_REN..._POWER_DEVICE(3) πŸ’–

ok bestie, welcome to the SDL3 FUNCTIONS section of the manual, and bestie we are talking about a hint. a Metal hint. a power hint. buckle up πŸ¦‹


✨ NAME ✨

SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE β€” it's a variable that controls whether the Metal render driver picks the low power device over the default one. like, does it choose the chill battery-friendly GPU or the regular one. that's the whole vibe check. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE"

so you pull in the header, and the macro literally just expands to that string. that's it. that's the girl. ✨


πŸŽ€ DESCRIPTION πŸŽ€

okay so the variable can be set to these values, no cap:

  • "0" β€” Use the preferred OS device. this one is the default, it's the main character, it's the one you get if you say nothing at all 🫢
  • "1" β€” Select a low power device. choosing this is giving battery-saver era, lowkey ✨
⚠️ real talk though β€” this hint should be set before creating a renderer. not after. before. set it late and it just won't do the thing, and that's on periodt 😭

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0. so if you're on anything older, it's giving nothing, i'm so sorry πŸ’€


and that's the whole page, bestie!! you ate. go set your hint before you make your renderer and live your best low-power life πŸ”₯πŸ‘‘

this lil manual page came to you from Simple Directmedia Layer, documenting SDL 3.4.18 β€” mwah, take care of her πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from