Function sdl2_sys::SDL_RWread
source · pub unsafe extern "C" fn SDL_RWread(
context: *mut SDL_RWops,
ptr: *mut c_void,
size: usize,
maxnum: usize,
) -> usize
Expand description
Read from a data source.
This function reads up to maxnum
objects each of size size
from the
data source to the area pointed at by ptr
. This function may read less
objects than requested. It will return zero when there has been an error or
the data stream is completely read.
SDL_RWread() is actually a function wrapper that calls the SDL_RWops’s
read
method appropriately, to simplify application development.
Prior to SDL 2.0.10, this function was a macro.
\param context a pointer to an SDL_RWops structure \param ptr a pointer to a buffer to read data into \param size the size of each object to read, in bytes \param maxnum the maximum number of objects to be read \returns the number of objects read, or 0 at error or end of file; call SDL_GetError() for more information.
\since This function is available since SDL 2.0.10.
\sa SDL_RWclose \sa SDL_RWFromConstMem \sa SDL_RWFromFile \sa SDL_RWFromFP \sa SDL_RWFromMem \sa SDL_RWseek \sa SDL_RWwrite