summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/windows/os_windows.cpp18
-rw-r--r--platform/windows/os_windows.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 352b7d645f..2284a51d58 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -705,6 +705,23 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) {
joystick->probe_joysticks();
} break;
+ case WM_SETCURSOR: {
+
+ if(LOWORD(lParam) == HTCLIENT) {
+ if(mouse_mode == MOUSE_MODE_HIDDEN) {
+ //Hide the cursor
+ if(hCursor == NULL)
+ hCursor = SetCursor(NULL);
+ }
+ else {
+ if(hCursor != NULL) {
+ SetCursor(hCursor);
+ hCursor = NULL;
+ }
+ }
+ }
+
+ } break;
default: {
@@ -1211,7 +1228,6 @@ void OS_Windows::set_mouse_mode(MouseMode p_mode) {
if (mouse_mode==p_mode)
return;
- ShowCursor(p_mode==MOUSE_MODE_VISIBLE);
mouse_mode=p_mode;
if (p_mode==MOUSE_MODE_CAPTURED) {
RECT clipRect;
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 81cf313849..adea26308f 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -103,6 +103,8 @@ class OS_Windows : public OS {
HDC hDC; // Private GDI Device Context
HINSTANCE hInstance; // Holds The Instance Of The Application
HWND hWnd;
+
+ HCURSOR hCursor;
Size2 window_rect;
VideoMode video_mode;