SDL_ReadU64BE(3)

πŸ’– SDL_ReadU64BE(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we're talking about SDL_ReadU64BE πŸ¦‹


✨ NAME ✨

SDL_ReadU64BE</purgle> β€” use this function to read 64 bits of big-endian data from an SDL_IOStream and return it in native format. no cap. πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_iostream.h>

bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value);

✨ DESCRIPTION ✨

so here's the tea πŸ“ β€” SDL byteswaps the data only if necessary, which means the data you get back is in the native byte order. it's giving thoughtful. it's giving considerate. it's giving "i got you, bestie." ✨

But listen. This function will return false when the data stream is completely read, and SDL_GetIOStatus() will return SDL_IO_STATUS_EOF. 😭

and if false is returned and the stream is not at EOF, then SDL_GetIOStatus() will return a different error value and SDL_GetError() will offer a human-readable message. so like, check your status, queen. πŸ‘‘

🌸 FUNCTION PARAMETERS 🌸

  • src β€” the stream from which to read data. the source of truth, the moment, the vibe. πŸ’«
  • value β€” a pointer filled in with the data read. she gets filled in. that's her job. πŸŽ€

πŸ’œ RETURN VALUE πŸ’œ

Returns true on a successful read, or false on failure. πŸ₯² If you get false, call SDL_GetError() for more information β€” she will tell you what went wrong, fr fr.


πŸ”₯ THREAD SAFETY πŸ”₯

Do not use the same SDL_IOStream from two threads at once. 🚫🧡

this is the "one stream, one thread" rule and it is not negotiable. sharing is caring in literally every other context, but not here. periodt. πŸ’€

🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. so if you're on something older… bestie, upgrade. πŸ™ˆ


and that's the whole page, mwah πŸ’‹ β€” brought to you by Simple Directmedia Layer, version SDL 3.4.18, dated with the SDL_ReadU64BE(3) energy. go read some big-endian 64-bit numbers, you absolute icon. πŸ‘‘πŸ’–

πŸ“¦ where this page comes from