Abstract base class for cross-platform window management. More...
#include <Window.h>
Public Types | |
using | EventCallbackFn = std::function<void(Events::Event&)> |
Public Member Functions | |
virtual void | OnUpdate ()=0 |
Updates the window (processes events, swaps buffers) | |
virtual unsigned int | GetWidth () const =0 |
Gets the window width. | |
virtual unsigned int | GetHeight () const =0 |
Gets the window height. | |
virtual void | SetEventCallback (const EventCallbackFn &callback)=0 |
Sets the event callback function for window events. | |
virtual void | SetVSync (bool enabled)=0 |
Enables or disables vertical synchronization. | |
virtual bool | IsVSync () const =0 |
Checks if VSync is currently enabled. | |
virtual void * | GetNativeWindow () const =0 |
Gets the native window handle. | |
Static Public Member Functions | |
static Window * | Create (const WindowProps &props=WindowProps()) |
Creates a platform-specific window instance. | |
Abstract base class for cross-platform window management.
The Window class provides a common interface for creating and managing windows across different platforms. Platform-specific implementations (e.g., MacWindow, WindowsWindow) inherit from this class and implement its pure virtual methods.
Features include:
|
static |
Creates a platform-specific window instance.
props | Window properties for initialization |
|
nodiscardpure virtual |
Gets the window height.
Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.
|
nodiscardpure virtual |
Gets the native window handle.
Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.
|
nodiscardpure virtual |
Gets the window width.
Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.
|
nodiscardpure virtual |
Checks if VSync is currently enabled.
Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.
|
pure virtual |
Updates the window (processes events, swaps buffers)
Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.
|
pure virtual |
Sets the event callback function for window events.
callback | Function to handle window events |
Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.
|
pure virtual |
Enables or disables vertical synchronization.
enabled | True to enable VSync, false to disable |
Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.