SDL_BlitSurfaceUnchecked(3)

πŸ’– SDL_BlitSurfaceUnchecked(3) πŸ’–

okay bestie, so this one lives in the SDL3 FUNCTIONS section of the manual and it's literally called SDL_BlitSurfaceUnchecked. let's get into it ✨


🌸 NAME 🌸

SDL_BlitSurfaceUnchecked β€” Perform low-level surface blitting only. periodt. πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3/SDL_surface.h>

bool SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect);

like. look at her. she's right there. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is a semi-private blit function, bestie. she does low-level surface blitting, and the way that she works is she assumes the input rectangles have already been clipped.

that's the whole vibe. no vibe check on your rects, no clipping safety net, she just goes. πŸ™ˆ


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • src β€” the SDL_Surface structure to be copied from. the source, the origin, the main character we're lifting pixels from πŸ‘‘
  • srcrect β€” the SDL_Rect structure representing the rectangle to be copied. heads up: this one may not be NULL. like, at all. 🚫
  • dst β€” the SDL_Surface structure that is the blit target. the destination. where the pixels land 🫢
  • dstrect β€” the SDL_Rect structure representing the target rectangle in the destination surface. and yep, this one may not be NULL either. πŸ’€

🌈 RETURN VALUE 🌈

returns true on success or false on failure. and if it fails?? call SDL_GetError() for more information β€” she will tell you what went wrong, ngl. 😭


🧚 THREAD SAFETY 🧚

Only one thread should be using the src and dst surfaces at any given time.

that's it, that's the rule. no sharing, no multitasking on the same surfaces, we don't do that here. 🚫🧡


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. she's new-ish and she ate πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

  • SDL_BlitSurface(3) β€” the safe one, the clipped one, the one you probably want first πŸ‘€

and that's the page, bestie!! source is Simple Directmedia Layer, version SDL 3.4.18, and it's the SDL_BlitSurfaceUnchecked(3) page πŸ’– go clip your rects first, love u, bye πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from