SDL_CopyProperties(3)
π SDL_CopyProperties π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_CopyProperties(3). she copies properties. she's literally so good at it. let's get into it π«Ά
β¨ NAME β¨
SDL_CopyProperties β copy a group of properties. that's it. that's the whole job. no cap. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_properties.h>
bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst);
look at her. two args. returns a bool. iconic. π
π¦ DESCRIPTION π¦
so here's the tea, bestie: this function copies all the properties from one group of properties to another. every single one. she's thorough.
BUT β and this is the plot twist β properties that require cleanup are not copied. those are the ones you set with SDL_SetPointerPropertyWithCleanup(), and they get left behind. no forwarding address. just gone. π
also important: any property that already exists on dst will be overwritten. so like, if dst had something cute going on, src is walking in and redecorating. respectfully? maybe not. but that's the vibe. π
π― FUNCTION PARAMETERS π―
srcβ the properties to copy. she's the giver, the source material, the blueprint. β¨dstβ the destination properties. she's receiving. she's the one getting a whole makeover. π
β RETURN VALUE β
returns true on success, or false on failure. if it's giving failure, call SDL_GetError() for more info β she will tell you what went wrong, fr fr. π
π₯ THREAD SAFETY π₯
it is safe to call this function from any thread. periodt. π«Ά
and the way that she does it? this function acquires simultaneous mutex locks on both the source and destination property sets. both of them. at the same time. she's holding two things and she's not dropping either one. queen behavior. π
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on anything older, bestie... it's not giving. upgrade. π
π sign-off π
that's the whole page, no notes. brought to you by Simple Directmedia Layer, version SDL 3.4.18 β go forth and copy those properties, you absolute legend. mwah. π β¨π§
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms