sdlLoadFileRw function

Pointer<NativeType> sdlLoadFileRw(
  1. Pointer<SdlRWops> src,
  2. Pointer<Uint32> datasize,
  3. int freesrc
)

Load all the data from an SDL data stream.

The data is allocated with a zero byte at the end (null terminated) for convenience. This extra byte is not included in the value reported via datasize.

The data should be freed with SDL_free().

\param src the SDL_RWops to read all available data from \param datasize if not NULL, will store the number of bytes read \param freesrc if non-zero, calls SDL_RWclose() on src before returning \returns the data, or NULL if there was an error.

\since This function is available since SDL 2.0.6.

extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src, size_t *datasize, int freesrc)

Implementation

Pointer<NativeType> sdlLoadFileRw(
    Pointer<SdlRWops> src, Pointer<Uint32> datasize, int freesrc) {
  final sdlLoadFileRwLookupFunction = libSdl2.lookupFunction<
      Pointer<NativeType> Function(
          Pointer<SdlRWops> src, Pointer<Uint32> datasize, Int32 freesrc),
      Pointer<NativeType> Function(Pointer<SdlRWops> src,
          Pointer<Uint32> datasize, int freesrc)>('SDL_LoadFile_RW');
  return sdlLoadFileRwLookupFunction(src, datasize, freesrc);
}