From 9a49c127d46ffa0aa5dd074f110e1ad7d7cf1edf Mon Sep 17 00:00:00 2001 From: redstrate <54911369+redstrate@users.noreply.github.com> Date: Wed, 23 Sep 2020 12:28:21 -0400 Subject: [PATCH] Add mouse down behavior on windows --- platforms/windows/main.cpp.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platforms/windows/main.cpp.in b/platforms/windows/main.cpp.in index 7d022d1..0e061ad 100755 --- a/platforms/windows/main.cpp.in +++ b/platforms/windows/main.cpp.in @@ -174,6 +174,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow } int timeout = 0; +bool mouse_down = false; LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { @@ -224,6 +225,13 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) int yPos = GET_Y_LPARAM(lParam); engine->process_mouse_down(0, {xPos, yPos}); + + mouse_down = true; + } + return 0; + case WM_LBUTTONUP: + { + mouse_down = false; } return 0; case WM_KEYDOWN: @@ -312,7 +320,7 @@ float platform::get_window_dpi(const int index) { } bool platform::get_mouse_button_down(const int index) { - return false; + return mouse_down; } float platform::get_monitor_dpi() {