gdk: Update Suspend/Resume best practices.

Updated testgdk to demonstrate correct handling of suspend/resume and the new Render APIs, and updated the docs to explain the correct usage of these GDK functions.
This commit is contained in:
Caleb Cornett
2026-03-07 07:16:36 -05:00
committed by Ethan Lee
parent ee5c5cf755
commit 12a435e11d
4 changed files with 61 additions and 20 deletions

View File

@@ -664,8 +664,11 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnregisterApp(void);
/**
* Callback from the application to let the suspend continue.
*
* This should be called from an event watch in response to an
* `SDL_EVENT_DID_ENTER_BACKGROUND` event.
* This should be called in response to an `SDL_EVENT_DID_ENTER_BACKGROUND` event,
* which can be detected via event watch. However, do NOT call this function
* directly from within an event watch callback. Instead, wait until the app has
* suppressed all rendering operations, then call this from the application
* render thread.
*
* When using SDL_Render, this should be called after calling SDL_GDKSuspendRenderer.
*