SDL_WriteS8(3)

πŸ’– SDL_WriteS8 πŸ’–

okay bestie, so this is a page from the SDL3 FUNCTIONS manual β€” yes, THE SDL, the Simple Directmedia Layer girlies πŸŽ€ β€” and today's main character is SDL_WriteS8. She's a little one-byte queen and she's about to eat. ✨


🌸 NAME 🌸

SDL_WriteS8 β€” use this function to write a signed byte to an SDL_IOStream. that's it. that's the whole job. and she does it flawlessly. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_iostream.h>

bool SDL_WriteS8(SDL_IOStream *dst, Sint8 value);

no cap, that's the whole signature. short. iconic. efficient. πŸ‘‘


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • dst β€” the SDL_IOStream you're writing to. this is where the byte goes, bestie, so like… pick a good one 🫢
  • value β€” the byte value to write. literally just the byte. that's her moment. ⭐

✨ RETURN VALUE ✨

Returns true on successful write, or false on failure. if it fails, do NOT just sit there spiralling β€” call SDL_GetError() for more information, she'll tell you what went wrong 😭


πŸ”₯ THREAD SAFETY πŸ”₯

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

fr fr. one stream, one thread at a time. sharing is caring everywhere EXCEPT here. πŸ’€


🌈 AVAILABILITY 🌈

This function is available since SDL 3.2.0. she's been around. she's established. she's not new here. πŸ‘‘


🧚 that's the whole page bestie 🧚

go forth and write your signed bytes, you absolute legend. πŸ’œ

β€” mwah, this was Simple Directmedia Layer, SDL 3.4.18, and the page is dated in that SDL_WriteS8(3) era πŸ“βœ¨ slay responsibly πŸ’–

πŸ“¦ where this page comes from