SDL_SetHint(3)

πŸ’– SDL_SetHint(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_SetHint β€” she sets a hint with normal priority and she does it fabulously. no cap.


✨ NAME ✨

SDL_SetHint β€” set a hint with normal priority. that's it, that's the whole job description. πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

bool SDL_SetHint(const char *name, const char *value);

look at her. two lil const char * besties and a bool return. iconic.


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, and it's important tea: hints will not be set if there's already an existing override hint or an environment variable that takes precedence over yours. like, sorry babe, someone more important already claimed that seat. πŸ’…

if you really need to force your hint through, you can use SDL_SetHintWithPriority() to set the hint with override priority instead. that's the "i'm the main character now" option. periodt.


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • name β€” the hint to set. literally just the name of the hint you're trying to set, bestie. πŸ“
  • value β€” the value of the hint variable. this is the actual juice you're putting in the hint. ✨

⭐ RETURN VALUE ⭐

returns true on success, or false on failure. 😭 and if it fails, call SDL_GetError() for more information β€” she will tell you exactly what went wrong, fr fr.


🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread. go wild. no vibes will be harmed. 🌈


πŸ‘‘ AVAILABILITY πŸ‘‘

this function has been available since SDL 3.2.0. she's been around a minute. πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

the whole hint squad, iykyk. 🫢


lowkey a warning but also just facts: if an override hint or an environment variable is already winning, your SDL_SetHint call is getting politely ignored. know the hierarchy, bestie. πŸ’€

and that's the page!! brought to you by Simple Directmedia Layer, version SDL 3.4.18 β€” mwah, love you, go set some hints responsibly πŸŒΈπŸ’–βœ¨

πŸ“¦ where this page comes from