Engine: add setters for game window rect

This commit is contained in:
Kawe Mazidjatari 2024-11-24 14:45:02 +01:00
parent bb99cec2fe
commit 7ee1626233
2 changed files with 21 additions and 0 deletions

View File

@ -121,6 +121,24 @@ void CGame::GetWindowRect(int* const x, int* const y, int* const w, int* const h
}
}
//-----------------------------------------------------------------------------
// Purpose: sets the window position
//-----------------------------------------------------------------------------
void CGame::SetWindowPosition(const int x, const int y)
{
m_x = x;
m_y = y;
}
//-----------------------------------------------------------------------------
// Purpose: sets the window size
//-----------------------------------------------------------------------------
void CGame::SetWindowSize(const int w, const int h)
{
m_width = w;
m_height = h;
}
//-----------------------------------------------------------------------------
// Purpose: dispatch key event
//-----------------------------------------------------------------------------

View File

@ -25,6 +25,9 @@ public:
inline HWND GetWindow() const { return m_hWindow; }
void GetWindowRect(int* const x, int* const y, int* const w, int* const h) const;
void SetWindowPosition(const int x, const int y);
void SetWindowSize(const int w, const int h);
inline int GetDesktopWidth() const { return m_iDesktopWidth; }
inline int GetDesktopHeight() const { return m_iDesktopHeight; }
inline int GetDesktopRefreshRate() const { return m_iDesktopRefreshRate; }