SDL_GETCURRENTRENDEROUTPUTSIZE(3)

πŸ’– SDL_GetCurrentRenderOutputSize(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_GetCurrentRenderOutputSize ✨ she's a lil function that tells you how big your render output actually is, in pixels. no cap.


🌸 NAME 🌸

SDL_GetCurrentRenderOutputSize β€” get the current output size in pixels of a rendering context πŸ–ΌοΈ


✨ SYNOPSIS ✨

#include <SDL3/SDL_render.h>

bool SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• if a rendering target is active, this function hands you back the size of that rendering target, measured in pixels. and if there's no rendering target active? then it just gives you whatever SDL_GetRenderOutputSize() says. either way you're getting an answer, she's not gonna leave you on read πŸ’…

and listen β€” rendering target or not, the output gets adjusted by the current logical presentation state, which is dictated by SDL_SetRenderLogicalPresentation(). so like, the logical presentation vibe check happens regardless. periodt.


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • renderer β€” the rendering context. that's your girl. the whole point. πŸ‘‘
  • w β€” a pointer that gets filled in with the current width πŸ“
  • h β€” a pointer that gets filled in with the current height πŸ“

πŸ”₯ RETURN VALUE πŸ”₯

returns true on success, or false on failure 😭 and if it fails, pls call SDL_GetError() for more info, she'll tell you what went wrong fr fr.


🧚 THREAD SAFETY 🧚

⚠️ this function should only be called on the main thread. no sneaking off to a background thread with this one, bestie. main character energy only, and the main thread is the main character πŸ’€

⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0 πŸ—“οΈ so if you're on anything older, sorry babe, she doesn't exist yet πŸ™ˆ


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page 🫢 shoutout to Simple Directmedia Layer, this is SDL 3.4.18, and yeah the header/footer keep trying to truncate the function name like SDL_GetCurren...derOutputSize(3) which is honestly giving "character limit on the group chat name" 😭 anyway ily, go render something iconic, mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from