| 60 | } |
| 61 | |
| 62 | void ImGUI_UpdateIO(int w, int h) |
| 63 | { |
| 64 | ImGuiIO& io = ImGui::GetIO(); |
| 65 | |
| 66 | // Setup display size (every frame to accommodate for window resizing) |
| 67 | RECT rect; |
| 68 | GetClientRect(g_hWnd, &rect); |
| 69 | ImVec2 windowSize((float)(rect.right - rect.left), (float)(rect.bottom - rect.top)); |
| 70 | |
| 71 | io.DisplaySize = ImVec2((float)w, (float)h); |
| 72 | |
| 73 | // Read keyboard modifiers inputs |
| 74 | io.KeyCtrl = (GetKeyState(VK_CONTROL) & 0x8000) != 0; |
| 75 | io.KeyShift = (GetKeyState(VK_SHIFT) & 0x8000) != 0; |
| 76 | io.KeyAlt = (GetKeyState(VK_MENU) & 0x8000) != 0; |
| 77 | io.KeySuper = false; |
| 78 | // io.KeysDown : filled by WM_KEYDOWN/WM_KEYUP events |
| 79 | // io.MousePos : filled by WM_MOUSEMOVE events |
| 80 | // io.MouseDown : filled by WM_*BUTTON* events |
| 81 | // io.MouseWheel : filled by WM_MOUSEWHEEL events |
| 82 | |
| 83 | // Hide OS mouse cursor if ImGui is drawing it |
| 84 | if (io.MouseDrawCursor) |
| 85 | SetCursor(NULL); // Start the frame |
| 86 | } |
| 87 | |
| 88 | static bool IsAnyMouseButtonDown() |
| 89 | { |