.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL's wiki page for SDL_BlitSurface: .\" https://wiki.libsdl.org/SDL_BlitSurface .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision SDL-3.1.0 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20SDL_BlitSurface .\" SDL can be found at https://libsdl.org/ .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH SDL_BlitSurface 3 "SDL 3.1.0" "SDL" "SDL3 FUNCTIONS" .SH NAME SDL_BlitSurface \- Performs a fast blit from the source surface to the destination surface\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3/SDL.h\(dq .PP .BI "int SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect); .fi .SH DESCRIPTION This assumes that the source and destination rectangles are the same size\[char46] If either .BR srcrect or .BR dstrect are NULL, the entire surface ( .BR src or .BR dst ) is copied\[char46] The final blit rectangles are saved in .BR srcrect and .BR dstrect after all clipping is performed\[char46] The blit function should not be called on a locked surface\[char46] The blit semantics for surfaces with and without blending and colorkey are defined as follows: .BR .BR c RGBA->RGB: Source surface blend mode set to SDL_BLENDMODE_BLEND: alpha-blend (using the source alpha-channel and per-surface alpha) SDL_SRCCOLORKEY ignored\[char46] Source surface blend mode set to SDL_BLENDMODE_NONE: copy RGB\[char46] if SDL_SRCCOLORKEY set, only copy the pixels matching the RGB values of the source color key, ignoring alpha in the comparison\[char46] RGB->RGBA: Source surface blend mode set to SDL_BLENDMODE_BLEND: alpha-blend (using the source per-surface alpha) Source surface blend mode set to SDL_BLENDMODE_NONE: copy RGB, set destination alpha to source per-surface alpha value\[char46] both: if SDL_SRCCOLORKEY set, only copy the pixels matching the source color key\[char46] RGBA->RGBA: Source surface blend mode set to SDL_BLENDMODE_BLEND: alpha-blend (using the source alpha-channel and per-surface alpha) SDL_SRCCOLORKEY ignored\[char46] Source surface blend mode set to SDL_BLENDMODE_NONE: copy all of RGBA to the destination\[char46] if SDL_SRCCOLORKEY set, only copy the pixels matching the RGB values of the source color key, ignoring alpha in the comparison\[char46] RGB->RGB: Source surface blend mode set to SDL_BLENDMODE_BLEND: alpha-blend (using the source per-surface alpha) Source surface blend mode set to SDL_BLENDMODE_NONE: copy RGB\[char46] both: if SDL_SRCCOLORKEY set, only copy the pixels matching the source color key\[char46] .BR .SH FUNCTION PARAMETERS .TP .I src the .BR SDL_Surface structure to be copied from .TP .I srcrect the .BR SDL_Rect structure representing the rectangle to be copied, or NULL to copy the entire surface .TP .I dst the .BR SDL_Surface structure that is the blit target .TP .I dstrect the .BR SDL_Rect structure representing the x and y position in the destination surface\[char46] On input the width and height are ignored (taken from srcrect), and on output this is filled in with the actual rectangle used after clipping\[char46] .SH RETURN VALUE Returns 0 on success or a negative error code on failure; call .BR SDL_GetError () for more information\[char46] .SH AVAILABILITY This function is available since SDL 3\[char46]0\[char46]0\[char46] .SH SEE ALSO .BR SDL_BlitSurfaceScaled (3)