SDL_BlitSurfaceScaled(3)

πŸ’– SDL_BlitSurfaceScaled πŸ’–

okay bestie, welcome to the manual page for SDL_BlitSurfaceScaled(3) β€” that's the SDL3 function page, and it's genuinely one of the good ones. ✨

🌸 NAME 🌸

SDL_BlitSurfaceScaled β€” perform a scaled blit to a destination surface, which may be of a different format. no cap, it does the copying and the resizing at the same time. main character energy fr. πŸ‘‘


✨ SYNOPSIS ✨

#include <SDL3/SDL_surface.h>

bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);

look at that signature, she's giving five whole arguments and every single one matters. 🫢


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • src β€” the SDL_Surface structure to be copied from. this is the source, the origin, the place we're stealing pixels from. πŸ‘‘
  • srcrect β€” the SDL_Rect structure representing the rectangle to be copied, or NULL to copy the entire surface. pass NULL and she takes everything, no crumbs left. πŸ’…
  • dst β€” the SDL_Surface structure that is the blit target. this is where the pixels are going, bestie. that's the destination. 🎯
  • dstrect β€” the SDL_Rect structure representing the target rectangle in the destination surface, or NULL to fill the entire destination surface. yup, NULL here means "cover the whole thing". 🌈
  • scaleMode β€” the SDL_ScaleMode to be used. yes it's literally about how the scaling happens. iconic. πŸ¦‹

πŸ’œ RETURN VALUE πŸ’œ

Returns true on success or false on failure β€” and if it's false, call SDL_GetError() for more information. do NOT just sit there wondering, the error string is right there, go read it. 😭


🧚 THREAD SAFETY 🧚

Only one thread should be using the src and dst surfaces at any given time. one. thread. at. a. time. this is not a vibe where you share. πŸ™ˆ


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. so if you're on something older, that's a you problem, go update. πŸ’€


🌈 SEE ALSO 🌈

  • SDL_BlitSurface(3) β€” the non-scaled sibling. same energy, no resizing. go say hi. πŸ“

and that's the whole page, bestie, you ate it. this was SDL_BlitSurfaceScaled(3) from Simple Directmedia Layer, SDL 3.4.18 β€” mwah, go blit something pretty. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from