SDL_WaitForGPUFences(3)

πŸ’– SDL_WaitForGPUFences πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_WaitForGPUFences(3) β€” the function that just waits. patiently. dramatically. on purpose.


🌸 NAME 🌸

SDL_WaitForGPUFences</purl> β€” blocks the thread until the given fences are signaled.

like literally, it will sit there. it will not move. it is ✨committed✨.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_gpu.h>

bool SDL_WaitForGPUFences(
    SDL_GPUDevice *device,
    bool wait_all,
    SDL_GPUFence *const *fences,
    Uint32 num_fences);

no cap, that's the whole vibe right there πŸ‘‘


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • device β€” a GPU context. it's giving "the whole entire world this function lives in" energy. you gotta hand it over.
  • wait_all β€” the picker of destinies, bestie:
    • if it's 0, you wait for any fence to be signaled (whoever gets there first, slay).
    • if it's 1, you wait for all fences to be signaled (every single one, no one left behind, periodt).
  • fences β€” an array of fences to wait on. yes, an array, plural energy, we love a group activity 🫢
  • num_fences β€” the number of fences in the fences array. gotta tell it how many besties are in the group chat.

πŸ’… RETURN VALUE πŸ’…

Returns true on success, false on failure. and if it fails? don't just stand there looking cute β€” call SDL_GetError() for more information, because it will tell you what went wrong 😭


✨ AVAILABILITY ✨

this function is available since SDL 3.2.0. so if you're on something older, no it's not, sorry babes πŸ™ˆ


πŸ”₯ SEE ALSO πŸ”₯

iykyk β€” go read those next, they're the whole friend group 🧚


and that's the page!! brought to you by Simple Directmedia Layer, living its SDL 3.4.18 era, and filed under SDL_WaitForGPUFences(3) forever and ever. πŸ’œβ­πŸŒˆ

πŸ“¦ where this page comes from