SDL 3.0
SDL_Surface Struct Reference

#include <SDL_surface.h>

Data Fields

SDL_SurfaceFlags flags
 
SDL_PixelFormat format
 
int w
 
int h
 
int pitch
 
void * pixels
 
int refcount
 
void * reserved
 

Detailed Description

A collection of pixels used in software blitting.

Pixels are arranged in memory in rows, with the top row first. Each row occupies an amount of memory given by the pitch (sometimes known as the row stride in non-SDL APIs).

Within each row, pixels are arranged from left to right until the width is reached. Each pixel occupies a number of bits appropriate for its format, with most formats representing each pixel as one or more whole bytes (in some indexed formats, instead multiple pixels are packed into each byte), and a byte order given by the format. After encoding all pixels, any remaining bytes to reach the pitch are used as padding to reach a desired alignment, and have undefined contents.

Since
This struct is available since SDL 3.1.3.
See also
SDL_CreateSurface
SDL_DestroySurface

Definition at line 123 of file SDL_surface.h.

Field Documentation

◆ flags

SDL_SurfaceFlags SDL_Surface::flags

The flags of the surface, read-only

Definition at line 125 of file SDL_surface.h.

◆ format

SDL_PixelFormat SDL_Surface::format

The format of the surface, read-only

Definition at line 126 of file SDL_surface.h.

◆ h

int SDL_Surface::h

The height of the surface, read-only.

Definition at line 128 of file SDL_surface.h.

◆ pitch

int SDL_Surface::pitch

The distance in bytes between rows of pixels, read-only

Definition at line 129 of file SDL_surface.h.

◆ pixels

void* SDL_Surface::pixels

A pointer to the pixels of the surface, the pixels are writeable if non-NULL

Definition at line 130 of file SDL_surface.h.

◆ refcount

int SDL_Surface::refcount

Application reference count, used when freeing surface

Definition at line 132 of file SDL_surface.h.

◆ reserved

void* SDL_Surface::reserved

Reserved for internal use

Definition at line 134 of file SDL_surface.h.

◆ w

int SDL_Surface::w

The width of the surface, read-only.

Definition at line 127 of file SDL_surface.h.


The documentation for this struct was generated from the following file: