SDL_SetGPUScissor(3)
π SDL_SetGPUScissor π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we learn how to crop our little render world. this one is SDL_SetGPUScissor β and no, it is not about cutting paper with fancy scissors, it is literally setting the current scissor state on a command buffer. it's giving pixel boundaries, but make it fashion. βοΈβ¨
πΈ NAME πΈ
SDL_SetGPUScissor β sets the current scissor state on a command buffer. that's it, that's the whole job, and she does it flawlessly. periodt. π
π SYNOPSIS π
first things first, you gotta invite her in:
#include <SDL3/SDL_gpu.h>
and here's the signature, copied exactly because we do not mess with the source of truth:
void SDL_SetGPUScissor(
SDL_GPURenderPass *render_pass,
const SDL_Rect *scissor);
yeah she returns void. she doesn't need to report back, she just does the thing and moves on. main character energy fr fr. π
π¦ FUNCTION PARAMETERS π¦
two little besties walk into a function call:
render_passβ a render pass handle. this is the vibe holder, the one that says "hey, we're rendering right now, in this pass." π«Άscissorβ the scissor area to set. anSDL_Rect, aka the rectangle where your drawing is allowed to live. everything outside? not invited to the party. π
π AVAILABILITY π
this function has been available since SDL 3.2.0. so if your SDL is older than that... bestie, it's giving vintage, and not in the cute way. upgrade. π§
heads up:scissoris a pointer to a constSDL_Rect, so you're handing her a rectangle to read, not to keep and scribble on. no cap. π
and that's the whole page!! slay π πΈπ¦
this cutie was brought to you by Simple Directmedia Layer, version SDL 3.4.18 β shoutout to the SDL_SetGPUScissor(3) era, we love her, we respect her, we clip our pixels with her. πβ¨π
π¦ 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