SDL_SetStringProperty(3)

πŸ’– SDL_SetStringProperty πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, where we set a string property in a group of properties and we do it flawlessly. no cap. ✨


✨ NAME ✨

SDL_SetStringProperty β€” set a string property in a group of properties. that's it. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_properties.h>

bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value);

like... look at her. three little params and she's doing the most. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the tea is: this function makes a copy of the string. copy. duplicate. clone. it's giving "i don't need you anymore" energy toward your original buffer, because the caller does not have to preserve the data after this call completes. you can free it, stack-allocate it, let it go out of scope, whatever β€” she already has her own copy and she is thriving. 🫢


πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • props β€” the properties to modify. this is the group chat you're sending the message into. πŸ‘‘
  • name β€” the name of the property to modify. which little slot are we updating, bestie?
  • value β€” the new value of the property, or NULL to delete the property. yeah, passing NULL is the "leave the group chat" button. πŸšͺ

⭐ RETURN VALUE ⭐

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


πŸ”₯ THREAD SAFETY πŸ”₯

it is safe to call this function from any thread. yes ma'am. every thread, all at once, no drama. main character energy for everybody. πŸ‘‘


🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. so if you're on something older, that's a no from her. πŸ™ˆ


πŸ“ SEE ALSO πŸ“


Simple Directmedia Layer said it best, and the version on deck is SDL 3.4.18. mwah, take care of yourselves, set your string properties responsibly, and i'll see you in the next man page. periodt. πŸ’…πŸ§šβœ¨

πŸ“¦ where this page comes from