sdlRWclose function

int sdlRWclose(
  1. Pointer<SdlRWops> context
)

Close and free an allocated SDL_RWops structure.

SDL_RWclose() closes and cleans up the SDL_RWops stream. It releases any resources used by the stream and frees the SDL_RWops itself with SDL_FreeRW(). This returns 0 on success, or -1 if the stream failed to flush to its output (e.g. to disk).

Note that if this fails to flush the stream to disk, this function reports an error, but the SDL_RWops is still invalid once this function returns.

Prior to SDL 2.0.10, this function was a macro.

\param context SDL_RWops structure to close \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.10.

\sa SDL_RWFromConstMem \sa SDL_RWFromFile \sa SDL_RWFromFP \sa SDL_RWFromMem \sa SDL_RWread \sa SDL_RWseek \sa SDL_RWwrite

extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context)

Implementation

int sdlRWclose(Pointer<SdlRWops> context) {
  final sdlRWcloseLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlRWops> context),
      int Function(Pointer<SdlRWops> context)>('SDL_RWclose');
  return sdlRWcloseLookupFunction(context);
}