SDL_CreateSurface(3)

SDL_CreateSurface3

Allocate a new surface with a specific pixel format.

Usage

#include "SDL3/SDL.h"

SDL_Surface * SDL_CreateSurface(int width, int height, SDL_PixelFormat format);

Header file

Defined in SDL3/SDL_surface.h

Overview

The pixels of the new surface are initialized to zero.

Function parameters

width

the width of the surface.

height

the height of the surface.

format

the SDL_PixelFormat
for the new surface's pixel format.

Return value

( SDL_Surface
*) 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.

Availability

This function is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.