From 9cf2e341adfdb389c0dd8eb9a621d83ccba78826 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Tue, 19 Jul 2022 23:52:56 +0200 Subject: Fix window resize on windows --- include/window.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include/window.hpp') diff --git a/include/window.hpp b/include/window.hpp index 3f0fa01..aeea39a 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -134,18 +134,22 @@ struct event { class window { public: - window(uint32_t width, uint32_t height); + window(uint32_t desired_width, uint32_t desired_height); ~window(); void poll_events(); - #if defined(WINDOWS) + void message_loop(); + LRESULT message_handler(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM lparam); static LRESULT CALLBACK window_procedure(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM lparam); - HWND win_handle; + HWND window_handle {}; + WNDCLASS window_class {}; + LPVOID main_fiber; + LPVOID message_loop_fiber; #elif defined(LINUX) xcb_connection_t* connection; xcb_window_t win; @@ -164,8 +168,8 @@ class window { bool isOpen; - bool keyboard[KEYS::MAX_KEYS] = { false }; - bool mouse[BUTTONS::MAX_BUTTONS] = { false }; + bool keyboard[KEYS::MAX_KEYS] { false }; + bool mouse[BUTTONS::MAX_BUTTONS] { false }; }; #endif // !__WINDOW_HPP_ -- cgit v1.3