sdlFlushIo function

bool sdlFlushIo(
  1. Pointer<SdlIoStream> context
)

Flush any buffered data in the stream.

This function makes sure that any buffered data is written to the stream. Normally this isn't necessary but if the stream is a pipe or socket it guarantees that any pending data is sent.

\param context SDL_IOStream structure to flush. \returns true on success or false on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

\sa SDL_OpenIO \sa SDL_WriteIO

extern SDL_DECLSPEC bool SDLCALL SDL_FlushIO(SDL_IOStream *context)

Implementation

bool sdlFlushIo(Pointer<SdlIoStream> context) {
  final sdlFlushIoLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlIoStream> context),
      int Function(Pointer<SdlIoStream> context)>('SDL_FlushIO');
  return sdlFlushIoLookupFunction(context) == 1;
}