aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/gui/sdl/Window.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/platform/gui/sdl/Window.h')
-rw-r--r--include/cru/platform/gui/sdl/Window.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/cru/platform/gui/sdl/Window.h b/include/cru/platform/gui/sdl/Window.h
index 0fd9b8e6..c9d6505b 100644
--- a/include/cru/platform/gui/sdl/Window.h
+++ b/include/cru/platform/gui/sdl/Window.h
@@ -1,8 +1,9 @@
#pragma once
-#include "../../GraphicsBase.h"
-#include "../Window.h"
#include "Base.h"
+#include <cru/platform/GraphicsBase.h>
+#include <cru/platform/gui/Window.h>
+
#include <SDL3/SDL_video.h>
#include <optional>
@@ -39,7 +40,17 @@ class SdlWindow : public SdlResource, public virtual INativeWindow {
Rect GetClientRect() override;
void SetClientRect(const Rect& rect) override;
+ /**
+ * Note: When the window is not created, this method will return an empty rect
+ * regardless of whether the window has a border.
+ */
Rect GetWindowRect() override;
+
+ /**
+ * Note: When the window is not created, the border is always considered empty
+ * regardless of the window style flag. So, you should always call this method
+ * after the window is created.
+ */
void SetWindowRect(const Rect& rect) override;
bool RequestFocus() override;
@@ -67,7 +78,7 @@ class SdlWindow : public SdlResource, public virtual INativeWindow {
float GetDisplayScale();
Thickness GetBorderThickness();
- private:
+ private:
void DoCreateWindow();
void DoUpdateClientRect();
void DoUpdateParent();
@@ -76,7 +87,7 @@ class SdlWindow : public SdlResource, public virtual INativeWindow {
private:
SdlUiApplication* application_;
- std::optional<SDL_Window*> sdl_window_;
+ SDL_Window* sdl_window_;
Rect client_rect_;
SdlWindow* parent_;
EventHandlerRevokerGuard parent_create_guard_;