SDL Wiki
(This is the legacy documentation for stable SDL2, the current stable version; SDL3 is the current development version.)


Performs a fast blit from the source surface to the destination surface.

Header File

Defined in [SDL_surface.h](, but apps should _only_ `#include "SDL.h"`!


#define SDL_BlitSurface SDL_UpperBlit

Return Value

Returns 0 if the blit is successful, otherwise it returns -1.

The blit function should not be called on a locked surface.

The blit semantics for surfaces with and without blending and colorkey are defined as follows:


This assumes that the source and destination rectangles are the same size. If either \c srcrect or \c dstrect are NULL, the entire surface (\c src or

Code Examples

extern SDL_Surface *surface;
extern SDL_Rect source_rect;
SDL_Surface *temp_surface;
SDL_BlitSurface(surface, &source_rect, temp_surface, NULL);

CategoryAPI, CategoryAPIMacro, CategorySurface

[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.