PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
pixelbullet::Window Class Referencefinal

Public Types

enum class  WindowState { Normal , Minimized , Maximized }

Public Member Functions

 Window (WindowConfig config)
void OnUpdate () noexcept
 Polls for and processes events.
void SetIcon (const Filesystem &filesystem, const VirtualPath &iconPath)
 Sets the window icon from an image file.
unsigned int GetWidth () const noexcept
 Accessors for window size.
unsigned int GetHeight () const noexcept
glm::ivec2 GetSize () const noexcept
glm::ivec2 GetPosition () const noexcept
glm::vec2 GetContentScale () const noexcept
unsigned int GetFramebufferWidth () const noexcept
unsigned int GetFramebufferHeight () const noexcept
glm::ivec2 GetFramebufferSize () const noexcept
void SetEventCallback (const std::function< void(pixelbullet::core::Event &)> &callback)
 Sets the callback that will be invoked when events occur.
void SetFramebufferResizeCallback (const std::function< void(uint32_t)> &callback)
const pixelbullet::input::InputStateGetInputState () const noexcept
bool IsKeyDown (pixelbullet::input::KeyCode key) const noexcept
void Minimize () noexcept
 Minimizes the window.
void Maximize () noexcept
 Maximizes the window.
void Restore () noexcept
 Restores the window from a minimized or maximized state.
void RequestClose () noexcept
 Requests application shutdown through the normal window-close event path.
bool SetClipboardText (std::string_view text)
 Sets the OS clipboard text for this window.
std::optional< std::string > GetClipboardText () const
 Returns the OS clipboard text for this window when available.
void ShowSystemMenuAt (const WindowPoint &client_point) noexcept
 Shows the native window system menu anchored at the given client-space point.
bool SupportsCustomChrome () const noexcept
 Returns whether the current platform backend supports custom chrome.
void SetCustomChromeLayout (const WindowChromeLayout &layout)
 Stores draggable caption regions for custom chrome windows.
void ClearCustomChromeLayout ()
 Clears the currently stored custom chrome layout.
void SetCursorCaptured (bool captured) noexcept
 Captures the OS cursor for relative first-person input.
bool IsCursorCaptured () const noexcept
 Returns whether the window is currently capturing the cursor.
bool IsMinimized () const noexcept
 Returns whether the window is currently minimized.
bool IsFocused () const noexcept
 Returns whether the window currently has focus.
bool IsMaximized () const noexcept
 Returns whether the window is currently maximized.
WindowState GetWindowState () const noexcept
 Returns the current window state.

Friends

struct window_internal::WindowAccess

Member Function Documentation

◆ ClearCustomChromeLayout()

void pixelbullet::Window::ClearCustomChromeLayout ( )

Clears the currently stored custom chrome layout.

◆ GetClipboardText()

std::optional< std::string > pixelbullet::Window::GetClipboardText ( ) const
nodiscard

Returns the OS clipboard text for this window when available.

◆ GetWidth()

unsigned int pixelbullet::Window::GetWidth ( ) const
noexcept

Accessors for window size.

◆ GetWindowState()

Window::WindowState pixelbullet::Window::GetWindowState ( ) const
noexcept

Returns the current window state.

◆ IsCursorCaptured()

bool pixelbullet::Window::IsCursorCaptured ( ) const
nodiscardnoexcept

Returns whether the window is currently capturing the cursor.

◆ IsFocused()

bool pixelbullet::Window::IsFocused ( ) const
noexcept

Returns whether the window currently has focus.

◆ IsMaximized()

bool pixelbullet::Window::IsMaximized ( ) const
noexcept

Returns whether the window is currently maximized.

◆ IsMinimized()

bool pixelbullet::Window::IsMinimized ( ) const
noexcept

Returns whether the window is currently minimized.

◆ Maximize()

void pixelbullet::Window::Maximize ( )
noexcept

Maximizes the window.

◆ Minimize()

void pixelbullet::Window::Minimize ( )
noexcept

Minimizes the window.

◆ OnUpdate()

void pixelbullet::Window::OnUpdate ( )
noexcept

Polls for and processes events.

◆ RequestClose()

void pixelbullet::Window::RequestClose ( )
noexcept

Requests application shutdown through the normal window-close event path.

◆ Restore()

void pixelbullet::Window::Restore ( )
noexcept

Restores the window from a minimized or maximized state.

◆ SetClipboardText()

bool pixelbullet::Window::SetClipboardText ( std::string_view text)
nodiscard

Sets the OS clipboard text for this window.

◆ SetCursorCaptured()

void pixelbullet::Window::SetCursorCaptured ( bool captured)
noexcept

Captures the OS cursor for relative first-person input.

◆ SetCustomChromeLayout()

void pixelbullet::Window::SetCustomChromeLayout ( const WindowChromeLayout & layout)

Stores draggable caption regions for custom chrome windows.

◆ SetEventCallback()

void pixelbullet::Window::SetEventCallback ( const std::function< void(pixelbullet::core::Event &)> & callback)

Sets the callback that will be invoked when events occur.

◆ SetIcon()

void pixelbullet::Window::SetIcon ( const Filesystem & filesystem,
const VirtualPath & iconPath )

Sets the window icon from an image file.

◆ ShowSystemMenuAt()

void pixelbullet::Window::ShowSystemMenuAt ( const WindowPoint & client_point)
noexcept

Shows the native window system menu anchored at the given client-space point.

◆ SupportsCustomChrome()

bool pixelbullet::Window::SupportsCustomChrome ( ) const
nodiscardnoexcept

Returns whether the current platform backend supports custom chrome.


The documentation for this class was generated from the following files: