Overload  1.1
Game engine with editor
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
OvWindowing::Window Class Reference

#include <Window.h>

Public Member Functions

 Window (const Context::Device &p_device, const Settings::WindowSettings &p_windowSettings)
 
 ~Window ()
 
void SetIcon (const std::string &p_filePath)
 
void SetIconFromMemory (uint8_t *p_data, uint32_t p_width, uint32_t p_height)
 
void SetSize (uint16_t p_width, uint16_t p_height)
 
void SetMinimumSize (int16_t p_minimumWidth, int16_t p_minimumHeight)
 
void SetMaximumSize (int16_t p_maximumWidth, int16_t p_maximumHeight)
 
void SetPosition (int16_t p_x, int16_t p_y)
 
void Minimize () const
 
void Maximize () const
 
void Restore () const
 
void Hide () const
 
void Show () const
 
void Focus () const
 
void SetShouldClose (bool p_value) const
 
bool ShouldClose () const
 
void SetFullscreen (bool p_value)
 
void ToggleFullscreen ()
 
bool IsFullscreen () const
 
bool IsHidden () const
 
bool IsVisible () const
 
bool IsMaximized () const
 
bool IsMinimized () const
 
bool IsFocused () const
 
bool IsResizable () const
 
bool IsDecorated () const
 
void MakeCurrentContext () const
 
void SwapBuffers () const
 
void SetCursorMode (Cursor::ECursorMode p_cursorMode)
 
void SetCursorShape (Cursor::ECursorShape p_cursorShape)
 
void SetCursorPosition (int16_t p_x, int16_t p_y)
 
void SetTitle (const std::string &p_title)
 
void SetRefreshRate (int32_t p_refreshRate)
 
std::string GetTitle () const
 
std::pair< uint16_t, uint16_t > GetSize () const
 
std::pair< int16_t, int16_t > GetMinimumSize () const
 
std::pair< int16_t, int16_t > GetMaximumSize () const
 
std::pair< int16_t, int16_t > GetPosition () const
 
std::pair< uint16_t, uint16_t > GetFramebufferSize () const
 
Cursor::ECursorMode GetCursorMode () const
 
Cursor::ECursorShape GetCursorShape () const
 
int32_t GetRefreshRate () const
 
GLFWwindow * GetGlfwWindow () const
 

Static Public Member Functions

static WindowFindInstance (GLFWwindow *p_glfwWindow)
 

Public Attributes

OvTools::Eventing::Event< int > KeyPressedEvent
 
OvTools::Eventing::Event< int > KeyReleasedEvent
 
OvTools::Eventing::Event< int > MouseButtonPressedEvent
 
OvTools::Eventing::Event< int > MouseButtonReleasedEvent
 
OvTools::Eventing::Event< uint16_t, uint16_t > ResizeEvent
 
OvTools::Eventing::Event< uint16_t, uint16_t > FramebufferResizeEvent
 
OvTools::Eventing::Event< int16_t, int16_t > MoveEvent
 
OvTools::Eventing::Event< int16_t, int16_t > CursorMoveEvent
 
OvTools::Eventing::Event MinimizeEvent
 
OvTools::Eventing::Event MaximizeEvent
 
OvTools::Eventing::Event GainFocusEvent
 
OvTools::Eventing::Event LostFocusEvent
 
OvTools::Eventing::Event CloseEvent
 

Detailed Description

A simple OS-based window. It needs a Device (GLFW) to work

Constructor & Destructor Documentation

◆ Window()

OvWindowing::Window::Window ( const Context::Device p_device,
const Settings::WindowSettings p_windowSettings 
)

Create the window

Parameters
p_device
p_windowSettings

◆ ~Window()

OvWindowing::Window::~Window ( )

Destructor of the window, responsible of the GLFW window memory free

Member Function Documentation

◆ FindInstance()

OvWindowing::Window * OvWindowing::Window::FindInstance ( GLFWwindow *  p_glfwWindow)
static

Find an instance of window with a given GLFWwindow

Parameters
p_glfwWindow

◆ Focus()

void OvWindowing::Window::Focus ( ) const

Focus the window

◆ GetCursorMode()

OvWindowing::Cursor::ECursorMode OvWindowing::Window::GetCursorMode ( ) const

Return the current cursor mode

◆ GetCursorShape()

OvWindowing::Cursor::ECursorShape OvWindowing::Window::GetCursorShape ( ) const

Return the current cursor shape

◆ GetFramebufferSize()

std::pair< uint16_t, uint16_t > OvWindowing::Window::GetFramebufferSize ( ) const

Return the framebuffer size (Viewport size)

◆ GetGlfwWindow()

GLFWwindow * OvWindowing::Window::GetGlfwWindow ( ) const

Return GLFW window

◆ GetMaximumSize()

std::pair< int16_t, int16_t > OvWindowing::Window::GetMaximumSize ( ) const

Return the current maximum size of the window

Note
-1 (WindowSettings::DontCare) values means no limitation

◆ GetMinimumSize()

std::pair< int16_t, int16_t > OvWindowing::Window::GetMinimumSize ( ) const

Return the current minimum size of the window

Note
-1 (WindowSettings::DontCare) values means no limitation

◆ GetPosition()

std::pair< int16_t, int16_t > OvWindowing::Window::GetPosition ( ) const

Return the current position of the window

◆ GetRefreshRate()

int32_t OvWindowing::Window::GetRefreshRate ( ) const

Return the current refresh rate (Only applied to the fullscreen mode). If the value is -1 (WindowSettings::DontCare) the highest refresh rate will be used

◆ GetSize()

std::pair< uint16_t, uint16_t > OvWindowing::Window::GetSize ( ) const

Return the current size of the window

◆ GetTitle()

std::string OvWindowing::Window::GetTitle ( ) const

Return the title of the window

◆ Hide()

void OvWindowing::Window::Hide ( ) const

Hides the specified window if it was previously visible

◆ IsDecorated()

bool OvWindowing::Window::IsDecorated ( ) const

Return true if the windows is decorated

◆ IsFocused()

bool OvWindowing::Window::IsFocused ( ) const

Return true if the windows is focused

◆ IsFullscreen()

bool OvWindowing::Window::IsFullscreen ( ) const

Return true if the window is fullscreen

◆ IsHidden()

bool OvWindowing::Window::IsHidden ( ) const

Return true if the window is hidden

◆ IsMaximized()

bool OvWindowing::Window::IsMaximized ( ) const

Return true if the windows is maximized

◆ IsMinimized()

bool OvWindowing::Window::IsMinimized ( ) const

Return true if the windows is minimized

◆ IsResizable()

bool OvWindowing::Window::IsResizable ( ) const

Return true if the windows is resizable

◆ IsVisible()

bool OvWindowing::Window::IsVisible ( ) const

Return true if the window is visible

◆ MakeCurrentContext()

void OvWindowing::Window::MakeCurrentContext ( ) const

Define the window as the current context

◆ Maximize()

void OvWindowing::Window::Maximize ( ) const

Maximize the window

◆ Minimize()

void OvWindowing::Window::Minimize ( ) const

Minimize the window

◆ Restore()

void OvWindowing::Window::Restore ( ) const

Restore the window

◆ SetCursorMode()

void OvWindowing::Window::SetCursorMode ( Cursor::ECursorMode  p_cursorMode)

Define a mode for the mouse cursor

Parameters
p_cursorMode

◆ SetCursorPosition()

void OvWindowing::Window::SetCursorPosition ( int16_t  p_x,
int16_t  p_y 
)

Move the cursor to the given position

◆ SetCursorShape()

void OvWindowing::Window::SetCursorShape ( Cursor::ECursorShape  p_cursorShape)

Define a shape to apply to the current cursor

Parameters
p_cursorShape

◆ SetFullscreen()

void OvWindowing::Window::SetFullscreen ( bool  p_value)

Set the window in fullscreen or windowed mode

Parameters
p_value(True for fullscreen mode, false for windowed)

◆ SetIcon()

void OvWindowing::Window::SetIcon ( const std::string &  p_filePath)

Set Icon

Parameters
p_filePath

◆ SetIconFromMemory()

void OvWindowing::Window::SetIconFromMemory ( uint8_t *  p_data,
uint32_t  p_width,
uint32_t  p_height 
)

Set Icon from memory

Parameters
p_data
p_width
p_height

◆ SetMaximumSize()

void OvWindowing::Window::SetMaximumSize ( int16_t  p_maximumWidth,
int16_t  p_maximumHeight 
)

Defines a maximum size for the window

Parameters
p_maximumWidth
p_maximumHeight
Note
-1 (WindowSettings::DontCare) value means no limitation

◆ SetMinimumSize()

void OvWindowing::Window::SetMinimumSize ( int16_t  p_minimumWidth,
int16_t  p_minimumHeight 
)

Defines a minimum size for the window

Parameters
p_minimumWidth
p_minimumHeight
Note
-1 (WindowSettings::DontCare) value means no limitation

◆ SetPosition()

void OvWindowing::Window::SetPosition ( int16_t  p_x,
int16_t  p_y 
)

Define a position for the window

Parameters
p_x
p_y

◆ SetRefreshRate()

void OvWindowing::Window::SetRefreshRate ( int32_t  p_refreshRate)

Defines a refresh rate (Use WindowSettings::DontCare to use the highest available refresh rate)

Parameters
p_refreshRate
Note
You need to switch to fullscreen mode to apply this effect (Or leave fullscreen and re-apply)

◆ SetShouldClose()

void OvWindowing::Window::SetShouldClose ( bool  p_value) const

Set the should close flag of the window to true

Parameters
p_value

◆ SetSize()

void OvWindowing::Window::SetSize ( uint16_t  p_width,
uint16_t  p_height 
)

Resize the window

Parameters
p_width
p_height

◆ SetTitle()

void OvWindowing::Window::SetTitle ( const std::string &  p_title)

Define a title for the window

Parameters
p_title

◆ ShouldClose()

bool OvWindowing::Window::ShouldClose ( ) const

Return true if the window should close

◆ Show()

void OvWindowing::Window::Show ( ) const

Show the specified window if it was previously hidden

◆ SwapBuffers()

void OvWindowing::Window::SwapBuffers ( ) const

Handle the buffer swapping with the current window

◆ ToggleFullscreen()

void OvWindowing::Window::ToggleFullscreen ( )

Switch the window to fullscreen or windowed mode depending on the current state

Member Data Documentation

◆ CloseEvent

OvTools::Eventing::Event OvWindowing::Window::CloseEvent

◆ CursorMoveEvent

OvTools::Eventing::Event<int16_t, int16_t> OvWindowing::Window::CursorMoveEvent

◆ FramebufferResizeEvent

OvTools::Eventing::Event<uint16_t, uint16_t> OvWindowing::Window::FramebufferResizeEvent

◆ GainFocusEvent

OvTools::Eventing::Event OvWindowing::Window::GainFocusEvent

◆ KeyPressedEvent

OvTools::Eventing::Event<int> OvWindowing::Window::KeyPressedEvent

◆ KeyReleasedEvent

OvTools::Eventing::Event<int> OvWindowing::Window::KeyReleasedEvent

◆ LostFocusEvent

OvTools::Eventing::Event OvWindowing::Window::LostFocusEvent

◆ MaximizeEvent

OvTools::Eventing::Event OvWindowing::Window::MaximizeEvent

◆ MinimizeEvent

OvTools::Eventing::Event OvWindowing::Window::MinimizeEvent

◆ MouseButtonPressedEvent

OvTools::Eventing::Event<int> OvWindowing::Window::MouseButtonPressedEvent

◆ MouseButtonReleasedEvent

OvTools::Eventing::Event<int> OvWindowing::Window::MouseButtonReleasedEvent

◆ MoveEvent

OvTools::Eventing::Event<int16_t, int16_t> OvWindowing::Window::MoveEvent

◆ ResizeEvent

OvTools::Eventing::Event<uint16_t, uint16_t> OvWindowing::Window::ResizeEvent

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