Merge pull request #19569 from hrydgard/imgui-integration

ImGui integration prototype
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2024-11-05 10:18:30 +01:00
commit c459d43f14
43 files changed
+58297 -56

No files matched your search

+43 -10
View File
@@ -632,9 +632,9 @@ namespace MainWindow
float y = GET_Y_LPARAM(lParam) * g_display.dpi_scale_y;
WindowsRawInput::SetMousePos(x, y);
TouchInput touch;
touch.id = 0;
touch.flags = TOUCH_DOWN;
TouchInput touch{};
touch.flags = TOUCH_DOWN | TOUCH_MOUSE;
touch.buttons = 1;
touch.x = x;
touch.y = y;
NativeTouch(touch);
@@ -680,10 +680,15 @@ namespace MainWindow
float y = (float)cursorY * g_display.dpi_scale_y;
WindowsRawInput::SetMousePos(x, y);
if (wParam & MK_LBUTTON) {
TouchInput touch;
touch.id = 0;
touch.flags = TOUCH_MOVE;
if (wParam & (MK_LBUTTON | MK_RBUTTON)) {
TouchInput touch{};
touch.flags = TOUCH_MOVE | TOUCH_MOUSE;
if (wParam & MK_LBUTTON) {
touch.buttons |= 1;
}
if (wParam & MK_RBUTTON) {
touch.buttons |= 2;
}
touch.x = x;
touch.y = y;
NativeTouch(touch);
@@ -702,9 +707,9 @@ namespace MainWindow
float y = (float)GET_Y_LPARAM(lParam) * g_display.dpi_scale_y;
WindowsRawInput::SetMousePos(x, y);
TouchInput touch;
touch.id = 0;
touch.flags = TOUCH_UP;
TouchInput touch{};
touch.buttons = 1;
touch.flags = TOUCH_UP | TOUCH_MOUSE;
touch.x = x;
touch.y = y;
NativeTouch(touch);
@@ -716,6 +721,34 @@ namespace MainWindow
touchHandler.handleTouchEvent(hWnd, message, wParam, lParam);
return 0;
case WM_RBUTTONDOWN:
{
float x = GET_X_LPARAM(lParam) * g_display.dpi_scale_x;
float y = GET_Y_LPARAM(lParam) * g_display.dpi_scale_y;
TouchInput touch{};
touch.buttons = 2;
touch.flags = TOUCH_DOWN | TOUCH_MOUSE;
touch.x = x;
touch.y = y;
NativeTouch(touch);
break;
}
case WM_RBUTTONUP:
{
float x = GET_X_LPARAM(lParam) * g_display.dpi_scale_x;
float y = GET_Y_LPARAM(lParam) * g_display.dpi_scale_y;
TouchInput touch{};
touch.buttons = 2;
touch.flags = TOUCH_UP | TOUCH_MOUSE;
touch.x = x;
touch.y = y;
NativeTouch(touch);
break;
}
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}