From 1b577a755e1e0495838486568fa0f7afd2926729 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Sat, 14 Feb 2026 09:38:22 +0100 Subject: [PATCH] [client,sdl] add toString for SDL_Rect --- client/SDL/SDL3/sdl_utils.cpp | 15 +++++++++++++++ client/SDL/SDL3/sdl_utils.hpp | 2 ++ 2 files changed, 17 insertions(+) diff --git a/client/SDL/SDL3/sdl_utils.cpp b/client/SDL/SDL3/sdl_utils.cpp index 436033106..49401d970 100644 --- a/client/SDL/SDL3/sdl_utils.cpp +++ b/client/SDL/SDL3/sdl_utils.cpp @@ -474,6 +474,21 @@ namespace sdl::utils return ss.str(); } + + std::string toString(SDL_Rect rect) + { + std::stringstream ss; + ss << "SDL_Rect{" << rect.x << "x" << rect.y << "-" << rect.w << "x" << rect.h << "}"; + return ss.str(); + } + + std::string toString(SDL_FRect rect) + { + std::stringstream ss; + ss << "SDL_Rect{" << rect.x << "x" << rect.y << "-" << rect.w << "x" << rect.h << "}"; + return ss.str(); + } + } // namespace sdl::utils namespace sdl::error diff --git a/client/SDL/SDL3/sdl_utils.hpp b/client/SDL/SDL3/sdl_utils.hpp index b4b449406..92ad4ec4d 100644 --- a/client/SDL/SDL3/sdl_utils.hpp +++ b/client/SDL/SDL3/sdl_utils.hpp @@ -86,6 +86,8 @@ namespace sdl::utils [[nodiscard]] std::string toString(SDL_DisplayOrientation orientation); [[nodiscard]] std::string toString(const SDL_DisplayMode* mode); [[nodiscard]] std::string toString(Uint32 type); + [[nodiscard]] std::string toString(SDL_Rect rect); + [[nodiscard]] std::string toString(SDL_FRect rect); [[nodiscard]] UINT32 orientaion_to_rdp(SDL_DisplayOrientation orientation);