SDL_Swap64(3)
π SDL_Swap64 β the glow-up for your bytes
okay bestie, welcome to SDL_Swap64(3) from the SDL3 FUNCTIONS crew β¨ this one lives in <SDL3/SDL_endian.h> and it's here to flip your 64-bit numbers around, endian-style π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_endian.h>
SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x);
β¨ DESCRIPTION β¨
so like, this function will always byte-swap the value. every single time. no vibe check first, no "hmm is this already in the native byteorder of the system?" β it does not care, it swaps regardless π
because of that, in most cases you should lowkey be using SDL_Swap64LE or SDL_Swap64BE instead. those are the ones that know what's up. this one is the raw, unfiltered, always-swapping version π
also important: this is a forced-inline function in a header, not a public API function chillin' inside the SDL library itself. translation for the group chat: the code gets embedded directly into the calling program, so the linker and the dynamic loader will not be able to find this function inside SDL itself. it's giving "not me, I'm in your binary now" π
π FUNCTION PARAMETERS π
xβ the value to byte-swap. that's it, that's the whole parameter, she's simple and she knows what she wants π
π RETURN VALUE π
Returns x, with its bytes in the opposite endian order. so same number, same name, completely flipped byte order. it's giving main character transformation arc π₯
π§ THREAD SAFETY π§
It is safe to call this function from any thread. no cap, every thread, all at once, go off π
β AVAILABILITY β
This function is available since SDL 3.2.0.
ngl, if you take one thing from this page: reach forSDL_Swap64LEorSDL_Swap64BEfirst unless you actually want the unconditional swap.SDL_Swap64will not ask questions, she will just swap π
and that's the whole page, bestie! π this absolute icon of a manual page comes courtesy of Simple Directmedia Layer, version SDL 3.4.18, dated SDL_Swap64(3) β mwah, love that for us π«Άπ
π¦ 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