SDL_ReadU32BE(3)
π SDL_ReadU32BE π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, where we're talking about SDL_ReadU32BE(3) β the girlies' favourite way to slurp 32 bits of big-endian data out of an SDL_IOStream and hand it back to you in native format. β¨
πΈ NAME πΈ
SDL_ReadU32BE β use this function to read 32 bits of big-endian data from an SDL_IOStream and return in native format. no cap, that's literally the whole job. π«Ά
β¨ SYNOPSIS β¨
#include <SDL3/SDL_iostream.h>
bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value);
π¦ DESCRIPTION π¦
SDL byteswaps the data only if necessary, so the data returned will be in the native byte order. so like, it's not doing extra work for no reason β it's giving considerate. π
This function will return false when the data stream is completely read, and SDL_GetIOStatus() will return SDL_IO_STATUS_EOF. If false is returned and the stream is not at EOF, SDL_GetIOStatus() will return a different error value and SDL_GetError() will offer a human-readable message. so like, false can mean two very different things and you gotta check which one it is. π
β οΈ lowkey important: false on its own does not tell you "the stream ended". it might be EOF, it might be a real error. the status function is the one who knows. π
π FUNCTION PARAMETERS π
srcβ the stream from which to read data. πvalueβ a pointer filled in with the data read. π
π RETURN VALUE π
Returns true on successful read or false on failure; call SDL_GetError() for more information. that's it, that's the whole vibe check. β
π THREAD SAFETY π
Do not use the same SDL_IOStream from two threads at once. fr fr, do not do it. one stream, one thread, that's the rule. β
β AVAILABILITY β
This function is available since SDL 3.2.0. π
and that's the tea, bestie! π this page came to you courtesy of Simple Directmedia Layer, sitting pretty at SDL 3.4.18, dated SDL_ReadU32BE(3) β so go forth, read those bytes, and stay slay. π
β¨π
π¦ 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