NoGUI: Merge in old branch and use base NoGUI class for SDL

This commit is contained in:
Connor McLaughlin
2021-01-31 02:28:14 +10:00
parent b09da307b5
commit 98bad30af8
17 changed files with 1610 additions and 698 deletions

View File

@ -0,0 +1,34 @@
#pragma once
#include "common/windows_headers.h"
#include "nogui_host_interface.h"
#include <memory>
#include <vector>
class Win32HostInterface final : public NoGUIHostInterface
{
public:
Win32HostInterface();
~Win32HostInterface();
bool Initialize();
void Shutdown();
static std::unique_ptr<NoGUIHostInterface> Create();
protected:
bool CreatePlatformWindow() override;
void DestroyPlatformWindow() override;
std::optional<WindowInfo> GetPlatformWindowInfo() override;
std::optional<HostKeyCode> GetHostKeyCode(const std::string_view key_code) const override;
void PollAndUpdate() override;
private:
static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
bool RegisterWindowClass();
void ProcessWin32Events();
HWND m_hwnd{};
};