Function sdl2_sys::SDL_RWFromFP
source · pub unsafe extern "C" fn SDL_RWFromFP(
fp: *mut c_void,
autoclose: SDL_bool,
) -> *mut SDL_RWops
Expand description
Use this function to create an SDL_RWops structure from a standard I/O file
pointer (stdio.h’s FILE*
).
This function is not available on Windows, since files opened in an application on that platform cannot be used by a dynamically linked library.
On some platforms, the first parameter is a void*
, on others, it’s a
FILE*
, depending on what system headers are available to SDL. It is
always intended to be the FILE*
type from the C runtime’s stdio.h.
\param fp the FILE*
that feeds the SDL_RWops stream
\param autoclose SDL_TRUE to close the FILE*
when closing the SDL_RWops,
SDL_FALSE to leave the FILE*
open when the RWops is
closed
\returns a pointer to the SDL_RWops structure that is created, or NULL on
failure; call SDL_GetError() for more information.
\since This function is available since SDL 2.0.0.
\sa SDL_RWclose \sa SDL_RWFromConstMem \sa SDL_RWFromFile \sa SDL_RWFromMem \sa SDL_RWread \sa SDL_RWseek \sa SDL_RWtell \sa SDL_RWwrite