From 8412f528538eb6baa2f7989318d337c0cac43688 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 08:57:30 -0700 Subject: [PATCH] Clarified that the renderer should be destroyed before the window I didn't add a note to SDL_DestroyWindow() because we actually protect against this case now, but it's useful information to know conceptually when working with the renderer. --- include/SDL3/SDL_render.h | 5 ++--- include/SDL3/SDL_video.h | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 5dc8fa3ef5..bb2fbe8711 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -2007,10 +2007,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); extern SDL_DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture *texture); /** - * Destroy the rendering context for a window and free associated textures. + * Destroy the rendering context for a window and free all associated textures. * - * If `renderer` is NULL, this function will return immediately after setting - * the SDL error message to "Invalid renderer". See SDL_GetError(). + * This should be called before destroying the associated window. * * \param renderer the rendering context. * diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index cdb911f71e..d536396102 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -2333,9 +2333,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOpe * Any popups or modal windows owned by the window will be recursively * destroyed as well. * - * If `window` is NULL, this function will return immediately after setting - * the SDL error message to "Invalid window". See SDL_GetError(). - * * \param window the window to destroy. * * \since This function is available since SDL 3.0.0.