sdlGetErrorMsg function

Pointer<Int8> sdlGetErrorMsg(
  1. Pointer<Int8> errstr,
  2. int maxlen
)

Get the last error message that was set for the current thread.

This allows the caller to copy the error string into a provided buffer, but otherwise operates exactly the same as SDL_GetError().

\param errstr A buffer to fill with the last error message that was set for the current thread \param maxlen The size of the buffer pointed to by the errstr parameter \returns the pointer passed in as the errstr parameter.

\since This function is available since SDL 2.0.14.

\sa SDL_GetError

extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen)

Implementation

Pointer<Int8> sdlGetErrorMsg(Pointer<Int8> errstr, int maxlen) {
  final sdlGetErrorMsgLookupFunction = libSdl2.lookupFunction<
      Pointer<Int8> Function(Pointer<Int8> errstr, Int32 maxlen),
      Pointer<Int8> Function(
          Pointer<Int8> errstr, int maxlen)>('SDL_GetErrorMsg');
  return sdlGetErrorMsgLookupFunction(errstr, maxlen);
}