SDL_GDKSuspendComplete(3)

πŸ’– SDL_GDKSuspendComplete(3) πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, pull up a chair, we're talking about SDL_GDKSuspendComplete and honestly? she's niche but she's important.


✨ NAME ✨

SDL_GDKSuspendComplete β€” the callback your app hits up to let the suspend keep going. like, "hey, i'm done here, you may proceed" energy. 🫢


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_main.h>

void SDL_GDKSuspendComplete(void);

that's it. no args, no return value, just vibes and a void. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: you're supposed to call this from an event watch, and specifically in response to an SDL_EVENT_DID_ENTER_BACKGROUND event. that's the whole moment she's built for. ✨

if you're using SDL_Render, listen closely: your event watch has to be added _after_ you create the SDL_Renderer. why? because that's what lets the timing of the D3D12 command queue suspension execute in the correct order. do it in the wrong order and it's giving chaos, not slay. 😭

if you're using SDL_GPU, then this should be called after you call SDL_GDKSuspendGPU. order matters, fr fr.

and if you're out here writing your own D3D12 renderer, main character behavior honestly, then this should be called after calling ID3D12CommandQueue::SuspendX. yes, exactly that one. πŸ’…

🚨 IMPORTANT: this function is only needed for Xbox GDK support. on all other platforms it will do nothing and set an "unsupported" error message. so if you're on, like, Linux, she's just gonna stand there. πŸ’€

πŸŽ€ THREAD SAFETY πŸŽ€

this function is not thread safe. do not pass her around the group chat. one thread at a time, bestie. πŸ™ˆ


🌈 AVAILABILITY 🌈

she's been around since SDL 3.2.0. a modern queen. ⭐


πŸ’œ SEE ALSO πŸ’œ


and that's the page!! brought to you by Simple Directmedia Layer, running SDL 3.4.18 β€” go forth and suspend responsibly, ily πŸ“πŸ§šπŸ’–

πŸ“¦ where this page comes from