EHS/src/io/BaseWindow.cpp

72 lines
1.2 KiB
C++
Raw Normal View History

2024-01-31 22:28:19 -08:00
#include "ehs/io/BaseWindow.h"
namespace ehs
{
BaseWindow::BaseWindow()
: created(false), focused(false), cursorVisible(true), cursorConstrained(false),
state(WindowState::NONE)
{
}
BaseWindow::BaseWindow(const BaseWindow &win)
: created(false), focused(false), cursorVisible(true), cursorConstrained(false),
state(WindowState::NONE)
{
}
BaseWindow &BaseWindow::operator=(const BaseWindow &win)
{
if (this == &win)
return *this;
created = false;
focused = false;
cursorPos = {};
cursorVisible = true;
cursorConstrained = false;
state = WindowState::NONE;
ih = {};
return *this;
}
bool BaseWindow::IsCreated() const
{
return created;
}
bool BaseWindow::Poll()
{
return true;
}
bool BaseWindow::HasFocus() const
{
return focused;
}
Vec2_s32 BaseWindow::GetCursorPos() const
{
return cursorPos;
}
bool BaseWindow::IsCursorVisible() const
{
return cursorVisible;
}
bool BaseWindow::IsCursorConstrained() const
{
return cursorConstrained;
}
WindowState BaseWindow::GetState() const
{
return state;
}
const InputHandler* BaseWindow::GetInputHandler() const
{
return &ih;
}
}