aboutsummaryrefslogtreecommitdiffstats
path: root/include/window.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/window.hpp')
-rw-r--r--include/window.hpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/include/window.hpp b/include/window.hpp
index 3298d36..dae4f00 100644
--- a/include/window.hpp
+++ b/include/window.hpp
@@ -2,6 +2,7 @@
#define __WINDOW_HPP_
#include <cstdint>
+#include <vector>
#include "defines.hpp"
@@ -9,23 +10,20 @@ class vkrenderer;
#if defined(LINUX)
#include <xcb/xcb.h>
+#elif defined(WINDOWS)
+#include <Windows.h>
+#endif
-class window {
- public:
- window(uint32_t width, uint32_t height);
-
- void poll_events();
-
- xcb_connection_t* connection;
- xcb_window_t win;
-
- uint32_t width;
- uint32_t height;
+enum EVENT_TYPES: int32_t {
+ QUIT,
+ RESIZE,
+};
- bool isOpen;
+struct event {
+ uint32_t width;
+ uint32_t height;
+ EVENT_TYPES type;
};
-#elif defined(WINDOWS)
-#include <Windows.h>
class window {
public:
@@ -33,18 +31,25 @@ class window {
void poll_events();
+
+#if defined(WINDOWS)
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;
- vkrenderer* renderer = nullptr;
+#elif defined(LINUX)
+ xcb_connection_t* connection;
+ xcb_window_t win;
+ xcb_atom_t win_delete_atom;
+#endif
+
+ std::vector<event> events;
uint32_t width;
uint32_t height;
bool isOpen;
};
-#endif
#endif // !__WINDOW_HPP_