SDL_RenderViewportSet(3)

πŸ’– SDL_RenderViewportSet(3) πŸ’–

Welcome to the SDL3 FUNCTIONS manual, bestie. This one is short, sweet, and weirdly specific. Periodt.


✨ NAME ✨

SDL_RenderViewportSet β€” return whether an explicit rectangle was set as the viewport. That's it. That's the whole job.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_render.h>

bool SDL_RenderViewportSet(SDL_Renderer *renderer);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this is the little detective function you call when you're saving and restoring the viewport and want to know whether you should restore a specific rectangle or NULL. No cap.

Each render target has its own viewport. This function checks the viewport for the current render target. Current. Render. Target. Don't forget it, iykyk.


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • renderer β€” the rendering context. That's the whole parameter list. Iconic minimalism.

πŸ‘‘ RETURN VALUE πŸ‘‘

Returns true if the viewport was set to a specific rectangle, or false if it was set to NULL (the entire target). Truthy rectangle vs. whole-target NULL energy.


πŸ’… THREAD SAFETY πŸ’…

This function should only be called on the main thread. Main thread only, bestie. Do not go wild in a worker thread. That's not the vibe.


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. Ancient? No. Just vintage enough.


🌈 SEE ALSO 🌈


xoxo, this page was served fresh from Simple Directmedia Layer, version SDL 3.4.18, and the footer energy of SDL_RenderViewportSet(3). Date? The SDL 3.4.18 moment, obviously. πŸ’–

πŸ“¦ where this page comes from