3#include "pixelbullet/core/event.h"
5#include "pixelbullet/input/input.h"
6#include "pixelbullet/window/window_chrome.h"
7#include "pixelbullet/window/window_config.h"
20namespace window_internal
32 enum class WindowState
49 unsigned int GetWidth()
const noexcept;
50 unsigned int GetHeight()
const noexcept;
51 glm::ivec2 GetSize()
const noexcept;
52 glm::ivec2 GetPosition()
const noexcept;
53 glm::vec2 GetContentScale()
const noexcept;
54 unsigned int GetFramebufferWidth()
const noexcept;
55 unsigned int GetFramebufferHeight()
const noexcept;
56 glm::ivec2 GetFramebufferSize()
const noexcept;
60 void SetFramebufferResizeCallback(
const std::function<
void(uint32_t)>& callback);
64 [[nodiscard]]
bool IsKeyDown(pixelbullet::input::KeyCode key)
const noexcept;
121 std::unique_ptr<window_internal::WindowState> state_;
Definition filesystem.h:19
Definition virtual_path.h:10
WindowState GetWindowState() const noexcept
Returns the current window state.
Definition window.cc:188
void RequestClose() noexcept
Requests application shutdown through the normal window-close event path.
Definition window.cc:128
void Maximize() noexcept
Maximizes the window.
Definition window.cc:118
bool IsFocused() const noexcept
Returns whether the window currently has focus.
Definition window.cc:178
void ShowSystemMenuAt(const WindowPoint &client_point) noexcept
Shows the native window system menu anchored at the given client-space point.
Definition window.cc:143
std::optional< std::string > GetClipboardText() const
Returns the OS clipboard text for this window when available.
Definition window.cc:138
void SetCustomChromeLayout(const WindowChromeLayout &layout)
Stores draggable caption regions for custom chrome windows.
Definition window.cc:153
void SetEventCallback(const std::function< void(pixelbullet::core::Event &)> &callback)
Sets the callback that will be invoked when events occur.
Definition window.cc:88
bool SetClipboardText(std::string_view text)
Sets the OS clipboard text for this window.
Definition window.cc:133
void Restore() noexcept
Restores the window from a minimized or maximized state.
Definition window.cc:123
bool IsCursorCaptured() const noexcept
Returns whether the window is currently capturing the cursor.
Definition window.cc:168
void ClearCustomChromeLayout()
Clears the currently stored custom chrome layout.
Definition window.cc:158
void SetCursorCaptured(bool captured) noexcept
Captures the OS cursor for relative first-person input.
Definition window.cc:163
void SetIcon(const Filesystem &filesystem, const VirtualPath &iconPath)
Sets the window icon from an image file.
Definition window.cc:108
unsigned int GetWidth() const noexcept
Accessors for window size.
Definition window.cc:39
bool SupportsCustomChrome() const noexcept
Returns whether the current platform backend supports custom chrome.
Definition window.cc:148
bool IsMaximized() const noexcept
Returns whether the window is currently maximized.
Definition window.cc:183
void OnUpdate() noexcept
Polls for and processes events.
Definition window.cc:33
void Minimize() noexcept
Minimizes the window.
Definition window.cc:113
bool IsMinimized() const noexcept
Returns whether the window is currently minimized.
Definition window.cc:173
Definition window_chrome.h:34
Definition window_config.h:11
Definition window_chrome.h:28
Definition window_internal.h:111
Definition window_internal.h:37