SDL_GetRenderOutputSize(3)
β¨ SDL_GetRenderOutputSize β¨
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today we're getting the output size in pixels of a rendering context π
πΈ NAME πΈ
SDL_GetRenderOutputSize β get the output size in pixels of a rendering context π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_render.h>
bool SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h);
π DESCRIPTION π
So like, this one returns the true output size in pixels β and the way it does that is by ignoring any render targets, and ignoring logical size and presentation too. It's giving "just the raw pixels, no filter, no edits" β¨
But wait β if you actually want the output size of the current rendering target, with all the logical size adjustments baked in, then you want SDL_GetCurrentRenderOutputSize() instead. Different function, different vibe, iykyk π«Ά
π FUNCTION PARAMETERS π
rendererβ the rendering context πwβ a pointer that gets filled in with the width in pixels.hβ a pointer that gets filled in with the height in pixels.
π RETURN VALUE π
Returns true on success or false on failure β and if it's a fail, call SDL_GetError() for more info, she'll tell you what went wrong π
π THREAD SAFETY π
This function should only be called on the main thread. No side-quests, no background threads, main character energy only π«π§΅
β AVAILABILITY β
This function is available since SDL 3.2.0 π«
π¦ SEE ALSO π¦
Simple Directmedia Layer β’ SDL 3.4.18 β’ SDL_GetRenderOutputSize(3)
and that's the whole page bestie, slay π β¨ go get those pixels ππ¦π
π¦ 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