Function sdl2_sys::SDL_ConvertSurface
source · pub unsafe extern "C" fn SDL_ConvertSurface(
src: *mut SDL_Surface,
fmt: *const SDL_PixelFormat,
flags: Uint32,
) -> *mut SDL_Surface
Expand description
Copy an existing surface to a new surface of the specified format.
This function is used to optimize images for faster repeat blitting. This is accomplished by converting the original and storing the result as a new surface. The new, optimized surface can then be used as the source for future blits, making them faster.
\param src the existing SDL_Surface structure to convert \param fmt the SDL_PixelFormat structure that the new surface is optimized for \param flags the flags are unused and should be set to 0; this is a leftover from SDL 1.2’s API \returns the new SDL_Surface structure that is created or NULL if it fails; call SDL_GetError() for more information.
\since This function is available since SDL 2.0.0.
\sa SDL_AllocFormat \sa SDL_ConvertSurfaceFormat \sa SDL_CreateRGBSurface