sdlIOvprintf function

int sdlIOvprintf(
  1. Pointer<SdlIoStream> context,
  2. String? fmt,
  3. Pointer<NativeType> arg2
)

Print to an SDL_IOStream data stream.

This function does formatted printing to the stream.

\param context a pointer to an SDL_IOStream structure. \param fmt a printf() style format string. \param ap a variable argument list. \returns the number of bytes written or 0 on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

\sa SDL_IOprintf \sa SDL_WriteIO

extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRINTF_FORMAT_STRING const char *fmt, va_list ap) SDL_PRINTF_VARARG_FUNCV(2)

Implementation

int sdlIOvprintf(
    Pointer<SdlIoStream> context, String? fmt, Pointer<NativeType> arg2) {
  final sdlIOvprintfLookupFunction = libSdl3.lookupFunction<
      Uint32 Function(Pointer<SdlIoStream> context, Pointer<Utf8> fmt,
          Pointer<NativeType> arg2),
      int Function(Pointer<SdlIoStream> context, Pointer<Utf8> fmt,
          Pointer<NativeType> arg2)>('SDL_IOvprintf');
  final fmtPointer = fmt != null ? fmt.toNativeUtf8() : nullptr;
  final result = sdlIOvprintfLookupFunction(context, fmtPointer, arg2);
  calloc.free(fmtPointer);
  return result;
}