sdlLog function

void sdlLog(
  1. String? fmt,
  2. Pointer<NativeType> arg1
)

Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.

= * \param fmt a printf() style message format string

\param ... additional parameters matching % tokens in the fmt string, if any

\since This function is available since SDL 2.0.0.

\sa SDL_LogCritical \sa SDL_LogDebug \sa SDL_LogError \sa SDL_LogInfo \sa SDL_LogMessage \sa SDL_LogMessageV \sa SDL_LogVerbose \sa SDL_LogWarn

extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1)

Implementation

void sdlLog(String? fmt, Pointer<NativeType> arg1) {
  final sdlLogLookupFunction = libSdl2.lookupFunction<
      Void Function(Pointer<Utf8> fmt, Pointer<NativeType> arg1),
      void Function(Pointer<Utf8> fmt, Pointer<NativeType> arg1)>('SDL_Log');
  final fmtPointer = fmt != null ? fmt.toNativeUtf8() : nullptr;
  final result = sdlLogLookupFunction(fmtPointer, arg1);
  calloc.free(fmtPointer);
  return result;
}