iw5-mod/src/launcher/window.hpp

23 lines
448 B
C++
Raw Normal View History

2018-12-23 07:17:08 -05:00
#pragma once
#define WM_KILL_WINDOW (WM_USER+0)
class window final
{
public:
window(const std::string& title, int width, int height);
~window();
void close();
void run() const;
operator HWND() const;
private:
WNDCLASSEX wc_{};
HWND handle_ = nullptr;
LRESULT CALLBACK processor(UINT message, WPARAM w_param, LPARAM l_param) const;
static LRESULT CALLBACK static_processor(HWND hwnd, UINT message, WPARAM w_param, LPARAM l_param);
};