Skip to main content

SDL_CreateSurface

Function SDL_CreateSurface 

Source
pub unsafe extern "C" fn SDL_CreateSurface(
    width: c_int,
    height: c_int,
    format: SDL_PixelFormat,
) -> *mut SDL_Surface
Expand description

Allocate a new surface with a specific pixel format.

The pixels of the new surface are initialized to zero.

Parameter: width the width of the surface. Parameter: height the height of the surface. Parameter: format the SDL_PixelFormat for the new surface’s pixel format. Returns: the new SDL_Surface structure that is created or NULL on failure; call SDL_GetError() for more information.

Thread Safety: It is safe to call this function from any thread.

Available Since: This function is available since SDL 3.2.0.

See Also: SDL_CreateSurfaceFrom See Also: SDL_DestroySurface