sdlWriteS16Le function

bool sdlWriteS16Le(
  1. Pointer<SdlIoStream> dst,
  2. int value
)

Use this function to write 16 bits in native format to an SDL_IOStream as little-endian data.

SDL byteswaps the data only if necessary, so the application always specifies native format, and the data written will be in little-endian format.

\param dst the stream to which data will be written. \param value the data to be written, in native format. \returns true on successful write or false on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value)

Implementation

bool sdlWriteS16Le(Pointer<SdlIoStream> dst, int value) {
  final sdlWriteS16LeLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlIoStream> dst, Int16 value),
      int Function(Pointer<SdlIoStream> dst, int value)>('SDL_WriteS16LE');
  return sdlWriteS16LeLookupFunction(dst, value) == 1;
}