sdlFlushIo function iostream

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.

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

\since This function is available since SDL 3.2.0.

\sa SDL_OpenIO \sa SDL_WriteIO

extern SDL_DECLSPEC bool SDLCALL SDL_FlushIO(SDL_IOStream *context)

Implementation

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