SDL_WriteS16LE(3)

✨ SDL_WriteS16LE ✨

okay bestie, welcome to the SDL_WriteS16LE(3) page from the SDL3 FUNCTIONS collection πŸ’– this one's a lil cutie from SDL_iostream.h and it's gonna write a 16-bit number to a stream for you. let's get into it 🫢


🌸 NAME 🌸

SDL_WriteS16LE β€” use this function to write 16 bits in native format to an SDL_IOStream as little-endian data πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_iostream.h>

bool SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• SDL byteswaps the data only if necessary, which means you, the application, always specify native format β€” and the data that actually gets written out will be in little-endian format. no cap. the conversion is SDL's problem, not yours, and honestly? iconic of them πŸ’œ


🌈 FUNCTION PARAMETERS 🌈

  • dst β€” the stream to which data will be written πŸ“ like, where's it going, bestie
  • value β€” the data to be written, in native format ✨

πŸ’… RETURN VALUE πŸ’…

Returns true on successful write or false on failure 😭 and if it fails, call SDL_GetError() for more information. she'll tell you what went wrong, periodt.


🧚 THREAD SAFETY 🧚

Do not use the same SDL_IOStream from two threads at once. fr fr. that's not a vibe, that's a race condition πŸ’€

⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0 πŸ‘‘


and that's the whole page, bestie!! this one came to you straight from Simple Directmedia Layer, version SDL 3.4.18, dated with the SDL_WriteS16LE(3) energy we all know and love 🌟 mwah, go write some little-endian bytes πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from