Elevate Engine 1
Loading...
Searching...
No Matches
Elevate::Window Class Referenceabstract

#include <Window.h>

Inheritance diagram for Elevate::Window:
Elevate::GlfwWindow

Public Member Functions

 Window ()=default
 
virtual ~Window ()
 
virtual void Init (const WindowProps &props)
 
virtual void OnUpdate ()=0
 
virtual unsigned int GetWidth () const =0
 
virtual unsigned int GetHeight () const =0
 
virtual bool GetFocus () const =0
 
virtual void SetEventCallback (const EventCallbackFn &callback)=0
 
virtual void SetVSync (bool enabled)=0
 
virtual bool IsVSync () const =0
 
virtual double GetTime () const =0
 
virtual void * GetNativeWindow () const =0
 
const WindowDataGetWindowData () const
 
void SetWindowSize (unsigned int width, unsigned int height)
 
void EventCallback (Event &event)
 

Static Public Member Functions

static WindowCreate (const WindowProps &props=WindowProps("app.config"))
 

Protected Attributes

WindowData m_Data
 

Detailed Description

Definition at line 37 of file Window.h.

Constructor & Destructor Documentation

◆ Window()

Elevate::Window::Window ( )
default

◆ ~Window()

virtual Elevate::Window::~Window ( )
inlinevirtual

Definition at line 41 of file Window.h.

41{ }

Member Function Documentation

◆ Create()

Window * Elevate::Window::Create ( const WindowProps props = WindowProps("app.config"))
static

Definition at line 77 of file Window.cpp.

78 {
79 return new PlatformWindow(props);
80 }

◆ EventCallback()

void Elevate::Window::EventCallback ( Event event)
inline

Definition at line 65 of file Window.h.

65{ m_Data.EventCallback(event); }
WindowData m_Data
Definition Window.h:68
EventCallbackFn EventCallback
Definition Window.h:18

◆ GetFocus()

virtual bool Elevate::Window::GetFocus ( ) const
pure virtual

Implemented in Elevate::GlfwWindow.

◆ GetHeight()

virtual unsigned int Elevate::Window::GetHeight ( ) const
pure virtual

Implemented in Elevate::GlfwWindow.

◆ GetNativeWindow()

virtual void * Elevate::Window::GetNativeWindow ( ) const
pure virtual

Implemented in Elevate::GlfwWindow.

◆ GetTime()

virtual double Elevate::Window::GetTime ( ) const
pure virtual

Implemented in Elevate::GlfwWindow.

◆ GetWidth()

virtual unsigned int Elevate::Window::GetWidth ( ) const
pure virtual

Implemented in Elevate::GlfwWindow.

◆ GetWindowData()

const WindowData & Elevate::Window::GetWindowData ( ) const
inline

Definition at line 62 of file Window.h.

62{ return m_Data; }

◆ Init()

void Elevate::Window::Init ( const WindowProps props)
virtual

Reimplemented in Elevate::GlfwWindow.

Definition at line 82 of file Window.cpp.

83 {
84 m_Data.Title = props.Title;
85 m_Data.Width = props.Width;
86 m_Data.Height = props.Height;
87 EE_CORE_TRACE("Creating window: {} ({}x{})", props.Title.c_str(), props.Width, props.Height);
88 }
unsigned int Width
Definition Window.h:14
unsigned int Height
Definition Window.h:14
std::string Title
Definition Window.h:13

◆ IsVSync()

virtual bool Elevate::Window::IsVSync ( ) const
pure virtual

Implemented in Elevate::GlfwWindow.

◆ OnUpdate()

virtual void Elevate::Window::OnUpdate ( )
pure virtual

Implemented in Elevate::GlfwWindow.

◆ SetEventCallback()

virtual void Elevate::Window::SetEventCallback ( const EventCallbackFn callback)
pure virtual

Implemented in Elevate::GlfwWindow.

◆ SetVSync()

virtual void Elevate::Window::SetVSync ( bool  enabled)
pure virtual

Implemented in Elevate::GlfwWindow.

◆ SetWindowSize()

void Elevate::Window::SetWindowSize ( unsigned int  width,
unsigned int  height 
)

Definition at line 90 of file Window.cpp.

91 {
92 EE_CORE_INFO("Setting window size to {}x{}", width, height);
93 m_Data.Width = width;
94 m_Data.Height = height;
95 WindowResizeEvent event(width, height);
96 EventCallback(event);
97 }
void EventCallback(Event &event)
Definition Window.h:65

Member Data Documentation

◆ m_Data

WindowData Elevate::Window::m_Data
protected

Definition at line 68 of file Window.h.


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