-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverlay.h
More file actions
42 lines (31 loc) · 894 Bytes
/
Overlay.h
File metadata and controls
42 lines (31 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <windows.h>
struct IDirect3DDevice9;
class Overlay
{
public:
enum class Backend { None, OpenGL, D3D9 };
static Overlay& Get();
void Attach();
void Detach();
void OnPresentGL(HDC hdc);
void OnPresentD3D9(IDirect3DDevice9* device);
LRESULT OnWndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
bool IsVisible() const { return m_visible; }
void ToggleVisible() { m_visible = !m_visible; }
private:
Overlay() = default;
void InitCommon(HWND hwnd);
void HookWindow(HWND hwnd);
void ApplyTheme();
void Render();
bool m_attached = false;
bool m_glHooked = false;
bool m_d3dHooked = false;
bool m_imguiReady = false;
bool m_backendReady = false;
Backend m_backend = Backend::None;
bool m_visible = true;
HWND m_window = nullptr;
WNDPROC m_originalWndProc = nullptr;
};