Arnold Engine
 
Loading...
Searching...
No Matches
AE::Core::Window Class Referenceabstract

Abstract base class for cross-platform window management. More...

#include <Window.h>

Inheritance diagram for AE::Core::Window:
AE::Platform::Linux::LinuxWindow AE::Platform::Mac::MacWindow AE::Platform::Windows::WindowsWindow

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 WindowCreate (const WindowProps &props=WindowProps())
 Creates a platform-specific window instance.
 

Detailed Description

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:

  • Window creation and destruction
  • Event handling
  • VSync control
  • Window property management (size, title, etc.)

Member Function Documentation

◆ Create()

Window * AE::Core::Window::Create ( const WindowProps & props = WindowProps())
static

Creates a platform-specific window instance.

Parameters
propsWindow properties for initialization
Returns
Pointer to created window instance

◆ GetHeight()

virtual unsigned int AE::Core::Window::GetHeight ( ) const
nodiscardpure virtual

Gets the window height.

Returns
Current window height in pixels

Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.

◆ GetNativeWindow()

virtual void * AE::Core::Window::GetNativeWindow ( ) const
nodiscardpure virtual

Gets the native window handle.

Returns
Pointer to the platform-specific window handle

Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.

◆ GetWidth()

virtual unsigned int AE::Core::Window::GetWidth ( ) const
nodiscardpure virtual

Gets the window width.

Returns
Current window width in pixels

Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.

◆ IsVSync()

virtual bool AE::Core::Window::IsVSync ( ) const
nodiscardpure virtual

Checks if VSync is currently enabled.

Returns
True if VSync is enabled, false otherwise

Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.

◆ OnUpdate()

virtual void AE::Core::Window::OnUpdate ( )
pure virtual

Updates the window (processes events, swaps buffers)

Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.

◆ SetEventCallback()

virtual void AE::Core::Window::SetEventCallback ( const EventCallbackFn & callback)
pure virtual

Sets the event callback function for window events.

Parameters
callbackFunction to handle window events

Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.

◆ SetVSync()

virtual void AE::Core::Window::SetVSync ( bool enabled)
pure virtual

Enables or disables vertical synchronization.

Parameters
enabledTrue to enable VSync, false to disable

Implemented in AE::Platform::Linux::LinuxWindow, AE::Platform::Mac::MacWindow, and AE::Platform::Windows::WindowsWindow.


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