SDL_SetGPUViewport(3)

πŸ’… SDL_SetGPUViewport(3) β€” the SDL3 FUNCTIONS girlies' cut ✨

okay bestie, so this is SDL_SetGPUViewport, living in the SDL3 FUNCTIONS manual, and it's literally the glow-up button for your render pass. sit down, hydrate, let's get into it 🫢


🌸 NAME 🌸

SDL_SetGPUViewport β€” sets the current viewport state on a command buffer. that's it. that's the whole job. she's a one-trick pony and she EATS every time πŸ‘‘


✨ SYNOPSIS ✨

#include <SDL3/SDL_gpu.h>

void SDL_SetGPUViewport(
    SDL_GPURenderPass *render_pass,
    const SDL_GPUViewport *viewport);

no return value, no drama, she just does the thing πŸ’…


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • render_pass β€” a render pass handle. yeah, the whole render pass. that's the thing she's gonna touch.
  • viewport β€” the viewport to set. the one you want. the one and only. hand it over 🫴

πŸ¦‹ AVAILABILITY πŸ¦‹

this one's been around since SDL 3.2.0 β€” so if you're on anything older, no viewport for you, sorry babe 😭

lowkey important: the viewport is being set on a command buffer, so it's state, not vibes. set it before you draw. iykyk.

Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_SetGPUViewport(3) β€” and that's the whole page, bestie, tysm for reading, mwah, go set some viewports πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ‘‘

πŸ“¦ where this page comes from