From 7ee1626233b690342b2c9eb6bd67b7ae37d003ac Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sun, 24 Nov 2024 14:45:02 +0100 Subject: [PATCH] Engine: add setters for game window rect --- src/engine/sys_mainwind.cpp | 18 ++++++++++++++++++ src/engine/sys_mainwind.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/src/engine/sys_mainwind.cpp b/src/engine/sys_mainwind.cpp index 703053ca..eb06e9ee 100644 --- a/src/engine/sys_mainwind.cpp +++ b/src/engine/sys_mainwind.cpp @@ -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 //----------------------------------------------------------------------------- diff --git a/src/engine/sys_mainwind.h b/src/engine/sys_mainwind.h index 64216f7b..355b86ee 100644 --- a/src/engine/sys_mainwind.h +++ b/src/engine/sys_mainwind.h @@ -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; }