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

@@ -4581,12 +4581,14 @@ extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUTextureFormatFromPixe
#ifdef SDL_PLATFORM_GDK
/**
* Call this to suspend GPU operation on Xbox when you receive the
* Call this to suspend GPU operation on Xbox after receiving the
* SDL_EVENT_DID_ENTER_BACKGROUND event.
*
* Do NOT call any SDL_GPU functions after calling this function! This must
* also be called before calling SDL_GDKSuspendComplete.
*
* This function MUST be called from the application's render thread.
*
* \param device a GPU context.
*
* \since This function is available since SDL 3.2.0.
@@ -4596,12 +4598,14 @@ extern SDL_DECLSPEC SDL_GPUTextureFormat SDLCALL SDL_GetGPUTextureFormatFromPixe
extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendGPU(SDL_GPUDevice *device);
/**
* Call this to resume GPU operation on Xbox when you receive the
* Call this to resume GPU operation on Xbox after receiving the
* SDL_EVENT_WILL_ENTER_FOREGROUND event.
*
* When resuming, this function MUST be called before calling any other
* SDL_GPU functions.
*
* This function MUST be called from the application's render thread.
*
* \param device a GPU context.
*
* \since This function is available since SDL 3.2.0.