CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::PlatformWindow Class Referenceabstract

#include <CeresEngine/Platform/PlatformWindow.hpp>

Inheritance diagram for CeresEngine::PlatformWindow:
CeresEngine::GLFWWindow CeresEngine::LinuxWindow CeresEngine::MacOSWindow CeresEngine::Win32Window CeresEngine::iOSWindow

Public Member Functions

 PlatformWindow (const PlatformWindowProperties &properties)
 
virtual ~PlatformWindow ()=default
 
virtual void activate ()=0
 Activates the window.
 
virtual void deactivate ()=0
 Deactivates the window.
 
virtual String getTitle () const =0
 Gets the window title.
 
virtual void setTitle (const String &title)=0
 Sets the window title.
 
virtual Vector2 getSize () const =0
 Gets the window size.
 
virtual void resize (double width, double height)=0
 Resizes the window.
 
void resize (const Vector2 size)
 Resizes the window.
 
virtual void close ()=0
 Closes the window.
 
virtual bool isFullscreen () const =0
 Gets the window full screen state.
 
virtual void setFullscreen (bool fullscreen)=0
 Sets the window to full screen.
 
virtual double getScalingFactor () const =0
 Gets the DPI scaling factor for this window.
 
void sendEvent (const AnyInputEvent &event)
 Sends a new event through the window.
 

Public Attributes

const PlatformWindowPropertiesproperties
 Generates a hash for the provided type.
 
Event< void(PlatformWindow &, Vector2)> didResize
 A signal that gets dispatched whenever the window gets resized.
 
Event< void(PlatformWindow &)> didClose
 A signal that gets dispatched whenever the window gets closed.
 
Event< void(const AnyInputEvent &)> onEvent
 An event fired when any input event is received on the window.
 
Event< void(const KeyEvent &)> onKeyDown
 An event fired when a key down event is received.
 
Event< void(const KeyEvent &)> onKeyUp
 An event fired when a key up event is received.
 
Event< void(const MouseEvent &)> onMouseDown
 An event fired when a mouse down event is received.
 
Event< void(const MouseEvent &)> onMouseUp
 An event fired when a mouse up event is received.
 
Event< void(const MouseEvent &)> onMouseMove
 An event fired when a mouse move event is received.
 
Event< void(const MouseEvent &)> onMouseDrag
 An event fired when a mouse drag eent is received.
 
Event< void(const MouseEvent &)> onMouseScroll
 An event fired when a mouse scroll event is received.
 
Event< void(const TextEvent &)> onTextInput
 An event fired when a text input event is received.
 
Event< void(const Rect2 &newRect, const Rect2 &oldRect)> didChangeFrame
 
Event< bool()> windowShouldClose
 

Constructor & Destructor Documentation

◆ PlatformWindow()

CeresEngine::PlatformWindow::PlatformWindow ( const PlatformWindowProperties properties)
inlineexplicit

◆ ~PlatformWindow()

virtual CeresEngine::PlatformWindow::~PlatformWindow ( )
virtualdefault

Member Function Documentation

◆ activate()

virtual void CeresEngine::PlatformWindow::activate ( )
pure virtual

◆ close()

virtual void CeresEngine::PlatformWindow::close ( )
pure virtual

◆ deactivate()

virtual void CeresEngine::PlatformWindow::deactivate ( )
pure virtual

◆ getScalingFactor()

virtual double CeresEngine::PlatformWindow::getScalingFactor ( ) const
pure virtual

Gets the DPI scaling factor for this window.

Implemented in CeresEngine::GLFWWindow, CeresEngine::iOSWindow, CeresEngine::MacOSWindow, and CeresEngine::Win32Window.

◆ getSize()

virtual Vector2 CeresEngine::PlatformWindow::getSize ( ) const
pure virtual

◆ getTitle()

virtual String CeresEngine::PlatformWindow::getTitle ( ) const
pure virtual

◆ isFullscreen()

virtual bool CeresEngine::PlatformWindow::isFullscreen ( ) const
pure virtual

Gets the window full screen state.

Returns
True if the window is in fullscreen, false otherwise

Implemented in CeresEngine::GLFWWindow, CeresEngine::iOSWindow, CeresEngine::LinuxWindow, CeresEngine::MacOSWindow, and CeresEngine::Win32Window.

◆ resize() [1/2]

void CeresEngine::PlatformWindow::resize ( const Vector2  size)
inline

Resizes the window.

Parameters
sizeThe window size

◆ resize() [2/2]

virtual void CeresEngine::PlatformWindow::resize ( double  width,
double  height 
)
pure virtual

Resizes the window.

Parameters
widthThe window's width
heightThe window's height

Implemented in CeresEngine::GLFWWindow, CeresEngine::iOSWindow, CeresEngine::LinuxWindow, CeresEngine::MacOSWindow, and CeresEngine::Win32Window.

◆ sendEvent()

void CeresEngine::PlatformWindow::sendEvent ( const AnyInputEvent event)

Sends a new event through the window.

Parameters
eventThe event to be send through the window.

◆ setFullscreen()

virtual void CeresEngine::PlatformWindow::setFullscreen ( bool  fullscreen)
pure virtual

Sets the window to full screen.

Parameters
fullscreenTrue to make the window fullscreen, false otherwise

Implemented in CeresEngine::GLFWWindow, CeresEngine::iOSWindow, CeresEngine::LinuxWindow, CeresEngine::MacOSWindow, and CeresEngine::Win32Window.

◆ setTitle()

virtual void CeresEngine::PlatformWindow::setTitle ( const String title)
pure virtual

Sets the window title.

Parameters
titleThe window title

Implemented in CeresEngine::GLFWWindow, CeresEngine::iOSWindow, CeresEngine::LinuxWindow, CeresEngine::MacOSWindow, and CeresEngine::Win32Window.

Member Data Documentation

◆ didChangeFrame

Event<void(const Rect2& newRect, const Rect2& oldRect)> CeresEngine::PlatformWindow::didChangeFrame

◆ didClose

Event<void(PlatformWindow&)> CeresEngine::PlatformWindow::didClose

A signal that gets dispatched whenever the window gets closed.

◆ didResize

Event<void(PlatformWindow&, Vector2)> CeresEngine::PlatformWindow::didResize

A signal that gets dispatched whenever the window gets resized.

◆ onEvent

Event<void(const AnyInputEvent&)> CeresEngine::PlatformWindow::onEvent

An event fired when any input event is received on the window.

◆ onKeyDown

Event<void(const KeyEvent&)> CeresEngine::PlatformWindow::onKeyDown

An event fired when a key down event is received.

◆ onKeyUp

Event<void(const KeyEvent&)> CeresEngine::PlatformWindow::onKeyUp

An event fired when a key up event is received.

◆ onMouseDown

Event<void(const MouseEvent&)> CeresEngine::PlatformWindow::onMouseDown

An event fired when a mouse down event is received.

◆ onMouseDrag

Event<void(const MouseEvent&)> CeresEngine::PlatformWindow::onMouseDrag

An event fired when a mouse drag eent is received.

◆ onMouseMove

Event<void(const MouseEvent&)> CeresEngine::PlatformWindow::onMouseMove

An event fired when a mouse move event is received.

◆ onMouseScroll

Event<void(const MouseEvent&)> CeresEngine::PlatformWindow::onMouseScroll

An event fired when a mouse scroll event is received.

◆ onMouseUp

Event<void(const MouseEvent&)> CeresEngine::PlatformWindow::onMouseUp

An event fired when a mouse up event is received.

◆ onTextInput

Event<void(const TextEvent&)> CeresEngine::PlatformWindow::onTextInput

An event fired when a text input event is received.

◆ properties

const PlatformWindowProperties& CeresEngine::PlatformWindow::properties

Generates a hash for the provided type.

Type must have a std::hash specialization.

Template Parameters
Tthe type to be hashed
Parameters
vThe value to be hashed
Returns
The hashed value

◆ windowShouldClose

Event<bool()> CeresEngine::PlatformWindow::windowShouldClose

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