25 class Win32 final :
public AWindow
30 ~Win32()
override =
default;
32 Win32(
const Win32 &) =
delete;
33 Win32 &operator=(
const Win32 &) =
delete;
34 Win32(Win32 &&) =
delete;
35 Win32 &operator=(Win32 &&) =
delete;
37 [[nodiscard]] std::string getName()
const override {
return "Win32"; }
41 bool create(
const std::string &name, WindowSize size)
override;
42 void close()
override;
44 [[nodiscard]] NativeWindowHandle getNativeHandle()
const override;
45 [[nodiscard]] WindowSize getWindowSize()
const override;
47 void setIcon(
const std::string &path)
const override;
49 [[nodiscard]]
bool shouldClose()
const override {
return m_shouldClose; }
50 void pollEvents()
override;
51 bool pollEvent(WindowEvent &event)
override;
53 bool wasResized()
const override {
return m_frameBufferResized; }
54 void resetResizedFlag()
override { m_frameBufferResized =
false; }
57 static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
58 static KeyCode mapWinKey(WPARAM key);
59 std::queue<WindowEvent> m_eventQueue;
62 HWND m_hwnd =
nullptr;
63 HINSTANCE m_hInstance =
nullptr;
64 WindowSize m_frameBufferSize;
65 bool m_frameBufferResized =
false;
66 bool m_shouldClose =
false;
This file contains the Window abstract class.