SDL_ReadS64BE(3)

πŸ’– SDL_ReadS64BE(3) πŸ’–

okay so bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_ReadS64BE 🫢


✨ NAME ✨

SDL_ReadS64BE β€” use this function to read 64 bits of big-endian data from an SDL_IOStream and return it in native format. slay πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_iostream.h>

bool SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea πŸ“ β€” SDL byteswaps the data only if necessary, so the data you get back will be in the native byte order. no wasted work, no drama, just vibes ✨

This function will return false when the data stream is completely read, and SDL_GetIOStatus() will return SDL_IO_STATUS_EOF. And if false gets returned but the stream is not at EOF?? then SDL_GetIOStatus() will return a different error value, and SDL_GetError() will hand you a human-readable message. iconic error handling fr fr 😭


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • src β€” the stream from which to read data. the source of truth, the origin story, the plug πŸ”Œ
  • value β€” a pointer filled in with the data read. it gets the goods πŸ“₯

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns true on successful read or false on failure. call SDL_GetError() for more information β€” she will tell you what went wrong, no cap πŸ’€


πŸ’œ THREAD SAFETY πŸ’œ

Do not use the same SDL_IOStream from two threads at once. that's not a suggestion bestie, that's the law 🚨

🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. she's been here, she's been ready πŸ’–


and that's the whole page, periodt ✨ go read some big-endian 64-bit integers and thrive 🧚

Simple Directmedia Layer β€” SDL 3.4.18 β€” SDL_ReadS64BE(3) πŸ’« thanks for coming to my ted talk, mwah πŸ«ΆπŸ’…

πŸ“¦ where this page comes from