38 GLFWwindow* window =
nullptr;
40 unsigned int width = 0;
41 unsigned int height = 0;
43 std::function<void(uint32_t)> framebuffer_resize_callback;
45 bool fullscreen =
false;
47 glm::ivec2 size{ 0, 0 };
48 glm::ivec2 fullscreen_size{ 0, 0 };
49 glm::ivec2 position{ 0, 0 };
50 glm::vec2 content_scale{ 1.0f, 1.0f };
53 bool cursor_capture_requested =
false;
54 bool cursor_captured =
false;
55 WindowFrameMode frame_mode = WindowFrameMode::SystemDecorated;
56 bool custom_chrome_supported =
false;
57 bool custom_chrome_attached =
false;
74 virtual void AcquireRuntime() = 0;
75 virtual void ReleaseRuntime()
noexcept = 0;
76 [[nodiscard]]
virtual unsigned int NextWindowId()
noexcept = 0;
77 virtual void DefaultWindowHints() = 0;
78 virtual void WindowHint(
int hint,
int value) = 0;
79 [[nodiscard]]
virtual GLFWwindow* CreateWindow(
int width,
int height,
const char* title) = 0;
80 virtual void DestroyWindow(GLFWwindow* window) = 0;
81 virtual void SetWindowUserPointer(GLFWwindow* window,
void* pointer) = 0;
82 [[nodiscard]]
virtual WindowSnapshot CaptureWindowSnapshot(GLFWwindow* window) = 0;
83 virtual void RegisterCallbacks(GLFWwindow* window) = 0;
84 virtual void PollEvents()
noexcept = 0;
85 virtual void WaitEventsTimeout(
double timeout_seconds)
noexcept = 0;
86 virtual void SetWindowIcon(GLFWwindow* window,
int count,
const GLFWimage* images) = 0;
87 virtual void IconifyWindow(GLFWwindow* window)
noexcept = 0;
88 virtual void MaximizeWindow(GLFWwindow* window)
noexcept = 0;
89 virtual void RestoreWindow(GLFWwindow* window)
noexcept = 0;
90 virtual void SetInputMode(GLFWwindow* window,
int mode,
int value)
noexcept = 0;
91 virtual void SetClipboardString(GLFWwindow* window,
const char* text)
noexcept = 0;
92 [[nodiscard]]
virtual const char* GetClipboardString(GLFWwindow* window)
const noexcept = 0;
93 [[nodiscard]]
virtual int GetWindowAttrib(GLFWwindow* window,
int attrib)
const noexcept = 0;
94 [[nodiscard]]
virtual int GetKey(GLFWwindow* window,
int key)
const noexcept = 0;
95 [[nodiscard]]
virtual glm::vec2 GetCursorPos(GLFWwindow* window)
const noexcept = 0;
112 [[nodiscard]]
static GLFWwindow*& NativeWindow(
Window& window)
noexcept;
113 [[nodiscard]]
static const GLFWwindow* NativeWindow(
const Window& window)
noexcept;
114 [[nodiscard]]
static std::string& Title(
Window& window)
noexcept;
115 [[nodiscard]]
static unsigned int& Width(
Window& window)
noexcept;
116 [[nodiscard]]
static unsigned int& Height(
Window& window)
noexcept;
117 [[nodiscard]]
static bool& Focused(
Window& window)
noexcept;
118 [[nodiscard]]
static bool& Fullscreen(
Window& window)
noexcept;
119 [[nodiscard]]
static glm::ivec2& Size(
Window& window)
noexcept;
120 [[nodiscard]]
static glm::ivec2& FullscreenSize(
Window& window)
noexcept;
121 [[nodiscard]]
static glm::ivec2& Position(
Window& window)
noexcept;
122 [[nodiscard]]
static glm::vec2& ContentScale(
Window& window)
noexcept;
125 [[nodiscard]]
static std::function<void(uint32_t)>& FramebufferResizeCallback(
Window& window)
noexcept;
126 [[nodiscard]]
static uint32_t& Id(
Window& window)
noexcept;
127 [[nodiscard]]
static bool& CursorCaptureRequested(
Window& window)
noexcept;
128 [[nodiscard]]
static bool& CursorCaptured(
Window& window)
noexcept;
129 [[nodiscard]]
static WindowFrameMode& FrameMode(
Window& window)
noexcept;
130 [[nodiscard]]
static bool& CustomChromeSupported(
Window& window)
noexcept;
131 [[nodiscard]]
static bool& CustomChromeAttached(
Window& window)
noexcept;
148class ScopedWindowChromeApiOverride
152 ~ScopedWindowChromeApiOverride();
154 ScopedWindowChromeApiOverride(
const ScopedWindowChromeApiOverride&) =
delete;
155 ScopedWindowChromeApiOverride& operator=(
const ScopedWindowChromeApiOverride&) =
delete;
163class ScopedIconBitmapLoaderOverride
166 explicit ScopedIconBitmapLoaderOverride(IconBitmapLoader loader);
167 ~ScopedIconBitmapLoaderOverride();
169 ScopedIconBitmapLoaderOverride(
const ScopedIconBitmapLoaderOverride&) =
delete;
170 ScopedIconBitmapLoaderOverride& operator=(
const ScopedIconBitmapLoaderOverride&) =
delete;
173 IconBitmapLoader previous_loader_;