SDL_WINDOWSUPPORTSGPUPRESENTMODE(3)

✨ SDL_WindowSupportsGPUPresentMode(3) ✨

okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual πŸ’… this one's called SDL_WindowSupportsGPUPresentMode and it lives in the SDL3 function family, no cap.


🌸 NAME 🌸

SDL_WindowSupportsGPUPresentMode β€” determines whether a presentation mode is supported by the window.

like. it literally just checks if your window can vibe with a given present mode. that's the whole job. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_gpu.h>

bool SDL_WindowSupportsGPUPresentMode(
    SDL_GPUDevice *device,
    SDL_Window *window,
    SDL_GPUPresentMode present_mode);

three args, one bool back. she's simple, she's efficient, she's iconic πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

The window must be claimed before calling this function.

and I cannot stress this enough bestie β€” CLAIMED FIRST. if you haven't claimed that window for the GPU device yet, this function is not gonna have a good time. go do your SDL_ClaimWindowForGPUDevice homework first, then come back. periodt. 🫢


πŸ“ FUNCTION PARAMETERS πŸ“

  • device β€” a GPU context. that's your GPU brain, your main character, the thing doing all the actual work ✨
  • window β€” an SDL_Window. yes. the window. the literal window. the one on your screen. 🌈
  • present_mode β€” the presentation mode to check. like we're putting it up against the vibe check and seeing if it passes πŸ’…

⭐ RETURN VALUE ⭐

Returns true if supported, false if unsupported.

that's it. that's the tea. true = slay, go ahead. false = nope, not happening, pick a different present mode babe 😭


πŸ¦‹ AVAILABILITY πŸ¦‹

This function is available since SDL 3.2.0.

so if you're on anything older than 3.2.0, she simply does not exist for you. upgrade era, fr fr πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’€ reminder bestie: claim the window. I'm not gonna say it a fourth time. (I said it four times.) 🫢

Simple Directmedia Layer β€’ SDL 3.4.18 β€” mwah, that's the version and the source, love that for us πŸ’– thanks for reading, go claim your window, drink some water, and stay hydrated my little GPU gremlin 🧚✨

πŸ“¦ where this page comes from