SDL_CreateProperties(3)

✨ SDL_CreateProperties(3) ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is literally a function that hands you a whole lil bag of properties πŸ’–


πŸŽ€ NAME πŸŽ€

SDL_CreateProperties β€” create a group of properties.

like. a little squad. a friend group. for your properties. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_properties.h>

SDL_PropertiesID SDL_CreateProperties(void);

no arguments, no drama, she just takes zero things and gives you a whole group 🫢


🌸 DESCRIPTION 🌸

So here's the tea: all properties are automatically destroyed when SDL_Quit() is called. πŸ”₯

Which is lowkey the best part?? Like you don't even have to remember to clean up, the cleanup is just... handled. iconic behaviour honestly. SDL_Quit() comes through and sweeps everything away, periodt.


πŸ‘‘ RETURN VALUE πŸ‘‘

She returns an ID for a new group of properties ✨ β€” or 0 on failure 😭.

And if you get that 0? Do not panic, bestie. Just call SDL_GetError() for more information, she will tell you exactly what went wrong πŸ“


πŸ’œ THREAD SAFETY πŸ’œ

It is safe to call this function from any thread. 🌈

No cap. Every thread. Go off, multitask, she's not gonna be weird about it πŸ™ˆ


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. πŸ¦‹

(so if you're on something older, that's giving ancient, and she's simply not there yet πŸ’€)


🌈 SEE ALSO 🌈


not me writing a whole love letter to a property container. anyway. she's useful, she's thread-safe, and she cleans up after herself. vibe check: passed πŸ’…βœ¨

Simple Directmedia Layer Β· SDL 3.4.18 Β· and yes, this was SDL_CreateProperties(3) the whole time πŸŽ€

mwah, go make some properties, ily, bye πŸ«ΆπŸ’–πŸŒΈ

πŸ“¦ where this page comes from