diff --git a/Editor/main_Windows.cpp b/Editor/main_Windows.cpp index 1440a3c04..56262576d 100644 --- a/Editor/main_Windows.cpp +++ b/Editor/main_Windows.cpp @@ -303,6 +303,25 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_DESTROY: PostQuitMessage(0); break; + case WM_SETCURSOR: + switch (LOWORD(lParam)) + { + case HTBOTTOM: + case HTBOTTOMLEFT: + case HTBOTTOMRIGHT: + case HTLEFT: + case HTRIGHT: + case HTTOP: + case HTTOPLEFT: + case HTTOPRIGHT: + // allow the system to handle these window resize cursors: + return DefWindowProc(hWnd, message, wParam, lParam); + default: + // notify the engine at other cursor changes to set its own cursor instead + wi::input::NotifyCursorChanged(); + break; + } + break; default: return DefWindowProc(hWnd, message, wParam, lParam); } diff --git a/WickedEngine/wiInput.cpp b/WickedEngine/wiInput.cpp index cf9a7a15d..37738da7a 100644 --- a/WickedEngine/wiInput.cpp +++ b/WickedEngine/wiInput.cpp @@ -843,6 +843,11 @@ namespace wi::input cursor_current = CURSOR_COUNT; } + void NotifyCursorChanged() + { + cursor_current = CURSOR_COUNT; + } + BUTTON StringToButton(const char* str) { if (str == nullptr) diff --git a/WickedEngine/wiInput.h b/WickedEngine/wiInput.h index 01e94bd7d..e97d6d437 100644 --- a/WickedEngine/wiInput.h +++ b/WickedEngine/wiInput.h @@ -267,6 +267,9 @@ namespace wi::input // Resets specified cursor to the original: void ResetCursor(CURSOR cursor); + // Notify the engine's input system that the OS changed the cursor from outside + void NotifyCursorChanged(); + BUTTON StringToButton(const char* str); enum CONTROLLER_PREFERENCE