SDL_GPUViewport(3type)
π NAME π
SDL_GPUViewport β it's a struct, bestie, and it's literally the thing that describes a viewport β¨
π SYNOPSIS π
Okay so first you gotta pull in the header, no cap:
#include <SDL3/SDL_gpu.h>
And here's the whole entire glow-up, six floats, that's it, that's the queen π
typedef struct SDL_GPUViewport
{
float x; /**< The left offset of the viewport. */
float y; /**< The top offset of the viewport. */
float w; /**< The width of the viewport. */
float h; /**< The height of the viewport. */
float min_depth; /**< The minimum depth of the viewport. */
float max_depth; /**< The maximum depth of the viewport. */
} SDL_GPUViewport;
So like, let's break it down because the way this is structured is giving main character energy πΈ
float xβ the left offset of the viewport. Where it starts horizontally, periodt.float yβ the top offset of the viewport. Where it starts vertically, iykyk.float wβ the width of the viewport. How wide she is πfloat hβ the height of the viewport. How tall she is π¦float min_depthβ the minimum depth of the viewport. The shallow end, lowkey.float max_depthβ the maximum depth of the viewport. The deep end, highkey.
It's giving "six numbers walk into a render pass" and honestly? Obsessed. π₯
π AVAILABILITY π
This struct has been serving looks since SDL 3.2.0. Available, iconic, no notes. β¨
π SEE ALSO π
SDL_SetGPUViewport(3)β the function that actually puts this bad boy to work. Go say hi π«Ά
Simple Directmedia Layer wrote this one, and we're repping SDL 3.4.18 over here, so like, you're reading the current era, fr fr π
Bye bestie, go set a viewport, slay π ππ¦
π¦ 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