aboutsummaryrefslogtreecommitdiff
path: root/client/src/ui/imgui/imgui_impl_win32.h
diff options
context:
space:
mode:
authorauth12 <[email protected]>2020-08-03 21:08:06 +0100
committerauth12 <[email protected]>2020-08-03 21:08:06 +0100
commitad8cf7c80590b96ad4e61f3f4eb397704a22ee4b (patch)
treef376bc6ce8b7ababd4bcc67bee748c6e1d672b0c /client/src/ui/imgui/imgui_impl_win32.h
parentStarted security. (diff)
downloadloader-ad8cf7c80590b96ad4e61f3f4eb397704a22ee4b.tar.xz
loader-ad8cf7c80590b96ad4e61f3f4eb397704a22ee4b.zip
Added ui.
Diffstat (limited to 'client/src/ui/imgui/imgui_impl_win32.h')
-rw-r--r--client/src/ui/imgui/imgui_impl_win32.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/client/src/ui/imgui/imgui_impl_win32.h b/client/src/ui/imgui/imgui_impl_win32.h
new file mode 100644
index 0000000..8923bd6
--- /dev/null
+++ b/client/src/ui/imgui/imgui_impl_win32.h
@@ -0,0 +1,37 @@
+// dear imgui: Platform Binding for Windows (standard windows API for 32 and 64 bits applications)
+// This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..)
+
+// Implemented features:
+// [X] Platform: Clipboard support (for Win32 this is actually part of core dear imgui)
+// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
+// [X] Platform: Keyboard arrays indexed using VK_* Virtual Key Codes, e.g. ImGui::IsKeyPressed(VK_SPACE).
+// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
+
+#pragma once
+#include "imgui.h" // IMGUI_IMPL_API
+
+IMGUI_IMPL_API bool ImGui_ImplWin32_Init(void* hwnd);
+IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown();
+IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame();
+
+// Configuration
+// - Disable gamepad support or linking with xinput.lib
+//#define IMGUI_IMPL_WIN32_DISABLE_GAMEPAD
+//#define IMGUI_IMPL_WIN32_DISABLE_LINKING_XINPUT
+
+// Win32 message handler your application need to call.
+// - Intentionally commented out in a '#if 0' block to avoid dragging dependencies on <windows.h> from this helper.
+// - You should COPY the line below into your .cpp code to forward declare the function and then you can call it.
+#if 0
+extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+#endif
+
+// DPI-related helpers (optional)
+// - Use to enable DPI awareness without having to create an application manifest.
+// - Your own app may already do this via a manifest or explicit calls. This is mostly useful for our examples/ apps.
+// - In theory we could call simple functions from Windows SDK such as SetProcessDPIAware(), SetProcessDpiAwareness(), etc.
+// but most of the functions provided by Microsoft require Windows 8.1/10+ SDK at compile time and Windows 8/10+ at runtime,
+// neither we want to require the user to have. So we dynamically select and load those functions to avoid dependencies.
+IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness();
+IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd); // HWND hwnd
+IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor); // HMONITOR monitor