SDL_GetSurfaceClipRect(3)
π SDL_GetSurfaceClipRect π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, page SDL_GetSurfaceClipRect(3) β yes that's a whole mouthful, we're gonna get through it together π«Ά
β¨ NAME β¨
SDL_GetSurfaceClipRect β get the clipping rectangle for a surface, no cap π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_surface.h>
bool SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect);
β¨ DESCRIPTION β¨
so here's the vibe: when surface is the destination of a blit, only the area within the clip rectangle is drawn into. that's it. that's the whole lore. everything outside that lil rectangle just doesn't get touched, periodt π
β¨ FUNCTION PARAMETERS β¨
surfaceβ theSDL_Surfacestructure representing the surface to be clipped. she's the main character here πrectβ anSDL_Rectstructure that gets filled in with the clipping rectangle for the surface. note the direction: it fills your rect in, you don't hand it one and it reads it. iykyk πΈ
β¨ RETURN VALUE β¨
returns true on success or false on failure π and if it's giving failure, call SDL_GetError() for more information β she'll tell you what went wrong, fr fr.
β¨ THREAD SAFETY β¨
this function can be called on different threads with different surfaces. so like, go off, parallelize, be that girl β just keep each thread on its own surface, bestie π
β¨ AVAILABILITY β¨
this function is available since SDL 3.2.0 β¨
β¨ SEE ALSO β¨
SDL_SetSurfaceClipRect(3)β the other half of the duo, go read her too π
not me getting emotional over a clip rect. anyway. π₯Ή
and that's the page!! brought to you by Simple Directmedia Layer, SDL version 3.4.18, filed under SDL_GetSurfaceClipRect(3) β mwah, slay, goodbye πππ¦
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms