2021-05-24 21:25:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "imgui.h"
|
2021-06-02 11:49:03 +00:00
|
|
|
#include "misc/cpp/imgui_stdlib.h"
|
2022-02-08 09:40:50 +00:00
|
|
|
#include <memory>
|
2021-05-24 21:25:31 +00:00
|
|
|
|
|
|
|
namespace metaforce {
|
|
|
|
class ImGuiEngine {
|
|
|
|
public:
|
2021-05-27 04:56:25 +00:00
|
|
|
static ImFont* fontNormal;
|
|
|
|
static ImFont* fontLarge;
|
2022-02-01 00:06:54 +00:00
|
|
|
static ImTextureID metaforceIcon;
|
|
|
|
};
|
2021-05-24 21:25:31 +00:00
|
|
|
|
2022-02-01 00:06:54 +00:00
|
|
|
// Called from Rust
|
|
|
|
void ImGuiEngine_Initialize(float scale);
|
2021-05-24 21:25:31 +00:00
|
|
|
|
2022-02-01 00:06:54 +00:00
|
|
|
struct ImGuiState;
|
|
|
|
struct DeviceHolder;
|
|
|
|
void ImGuiEngine_AddTextures(ImGuiState& state, const DeviceHolder& gpu);
|
2021-05-24 21:25:31 +00:00
|
|
|
|
2022-02-08 08:28:56 +00:00
|
|
|
struct Icon {
|
|
|
|
std::unique_ptr<uint8_t[]> data;
|
|
|
|
size_t size;
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
};
|
|
|
|
Icon GetIcon();
|
|
|
|
|
2022-02-01 00:06:54 +00:00
|
|
|
enum class KeyCode {
|
|
|
|
/// The '1' key over the letters.
|
|
|
|
Key1,
|
|
|
|
/// The '2' key over the letters.
|
|
|
|
Key2,
|
|
|
|
/// The '3' key over the letters.
|
|
|
|
Key3,
|
|
|
|
/// The '4' key over the letters.
|
|
|
|
Key4,
|
|
|
|
/// The '5' key over the letters.
|
|
|
|
Key5,
|
|
|
|
/// The '6' key over the letters.
|
|
|
|
Key6,
|
|
|
|
/// The '7' key over the letters.
|
|
|
|
Key7,
|
|
|
|
/// The '8' key over the letters.
|
|
|
|
Key8,
|
|
|
|
/// The '9' key over the letters.
|
|
|
|
Key9,
|
|
|
|
/// The '0' key over the 'O' and 'P' keys.
|
|
|
|
Key0,
|
|
|
|
|
|
|
|
A,
|
|
|
|
B,
|
|
|
|
C,
|
|
|
|
D,
|
|
|
|
E,
|
|
|
|
F,
|
|
|
|
G,
|
|
|
|
H,
|
|
|
|
I,
|
|
|
|
J,
|
|
|
|
K,
|
|
|
|
L,
|
|
|
|
M,
|
|
|
|
N,
|
|
|
|
O,
|
|
|
|
P,
|
|
|
|
Q,
|
|
|
|
R,
|
|
|
|
S,
|
|
|
|
T,
|
|
|
|
U,
|
|
|
|
V,
|
|
|
|
W,
|
|
|
|
X,
|
|
|
|
Y,
|
|
|
|
Z,
|
|
|
|
|
|
|
|
/// The Escape key, next to F1.
|
|
|
|
Escape,
|
|
|
|
|
|
|
|
F1,
|
|
|
|
F2,
|
|
|
|
F3,
|
|
|
|
F4,
|
|
|
|
F5,
|
|
|
|
F6,
|
|
|
|
F7,
|
|
|
|
F8,
|
|
|
|
F9,
|
|
|
|
F10,
|
|
|
|
F11,
|
|
|
|
F12,
|
|
|
|
F13,
|
|
|
|
F14,
|
|
|
|
F15,
|
|
|
|
F16,
|
|
|
|
F17,
|
|
|
|
F18,
|
|
|
|
F19,
|
|
|
|
F20,
|
|
|
|
F21,
|
|
|
|
F22,
|
|
|
|
F23,
|
|
|
|
F24,
|
|
|
|
|
|
|
|
/// Print Screen/SysRq.
|
|
|
|
Snapshot,
|
|
|
|
/// Scroll Lock.
|
|
|
|
Scroll,
|
|
|
|
/// Pause/Break key, next to Scroll lock.
|
|
|
|
Pause,
|
|
|
|
|
|
|
|
/// `Insert`, next to Backspace.
|
|
|
|
Insert,
|
|
|
|
Home,
|
|
|
|
Delete,
|
|
|
|
End,
|
|
|
|
PageDown,
|
|
|
|
PageUp,
|
|
|
|
|
|
|
|
Left,
|
|
|
|
Up,
|
|
|
|
Right,
|
|
|
|
Down,
|
|
|
|
|
|
|
|
/// The Backspace key, right over Enter.
|
|
|
|
// TODO: rename
|
|
|
|
Back,
|
|
|
|
/// The Enter key.
|
|
|
|
Return,
|
|
|
|
/// The space bar.
|
|
|
|
Space,
|
|
|
|
|
|
|
|
/// The "Compose" key on Linux.
|
|
|
|
Compose,
|
|
|
|
|
|
|
|
Caret,
|
|
|
|
|
|
|
|
Numlock,
|
|
|
|
Numpad0,
|
|
|
|
Numpad1,
|
|
|
|
Numpad2,
|
|
|
|
Numpad3,
|
|
|
|
Numpad4,
|
|
|
|
Numpad5,
|
|
|
|
Numpad6,
|
|
|
|
Numpad7,
|
|
|
|
Numpad8,
|
|
|
|
Numpad9,
|
|
|
|
NumpadAdd,
|
|
|
|
NumpadDivide,
|
|
|
|
NumpadDecimal,
|
|
|
|
NumpadComma,
|
|
|
|
NumpadEnter,
|
|
|
|
NumpadEquals,
|
|
|
|
NumpadMultiply,
|
|
|
|
NumpadSubtract,
|
2021-05-24 21:25:31 +00:00
|
|
|
|
2022-02-01 00:06:54 +00:00
|
|
|
AbntC1,
|
|
|
|
AbntC2,
|
|
|
|
Apostrophe,
|
|
|
|
Apps,
|
|
|
|
Asterisk,
|
|
|
|
At,
|
|
|
|
Ax,
|
|
|
|
Backslash,
|
|
|
|
Calculator,
|
|
|
|
Capital,
|
|
|
|
Colon,
|
|
|
|
Comma,
|
|
|
|
Convert,
|
|
|
|
Equals,
|
|
|
|
Grave,
|
|
|
|
Kana,
|
|
|
|
Kanji,
|
|
|
|
LAlt,
|
|
|
|
LBracket,
|
|
|
|
LControl,
|
|
|
|
LShift,
|
|
|
|
LWin,
|
|
|
|
Mail,
|
|
|
|
MediaSelect,
|
|
|
|
MediaStop,
|
|
|
|
Minus,
|
|
|
|
Mute,
|
|
|
|
MyComputer,
|
|
|
|
// also called "Next"
|
|
|
|
NavigateForward,
|
|
|
|
// also called "Prior"
|
|
|
|
NavigateBackward,
|
|
|
|
NextTrack,
|
|
|
|
NoConvert,
|
|
|
|
OEM102,
|
|
|
|
Period,
|
|
|
|
PlayPause,
|
|
|
|
Plus,
|
|
|
|
Power,
|
|
|
|
PrevTrack,
|
|
|
|
RAlt,
|
|
|
|
RBracket,
|
|
|
|
RControl,
|
|
|
|
RShift,
|
|
|
|
RWin,
|
|
|
|
Semicolon,
|
|
|
|
Slash,
|
|
|
|
Sleep,
|
|
|
|
Stop,
|
|
|
|
Sysrq,
|
|
|
|
Tab,
|
|
|
|
Underline,
|
|
|
|
Unlabeled,
|
|
|
|
VolumeDown,
|
|
|
|
VolumeUp,
|
|
|
|
Wake,
|
|
|
|
WebBack,
|
|
|
|
WebFavorites,
|
|
|
|
WebForward,
|
|
|
|
WebHome,
|
|
|
|
WebRefresh,
|
|
|
|
WebSearch,
|
|
|
|
WebStop,
|
|
|
|
Yen,
|
|
|
|
Copy,
|
|
|
|
Paste,
|
|
|
|
Cut,
|
2021-05-24 21:25:31 +00:00
|
|
|
};
|
|
|
|
} // namespace metaforce
|