diff -r 3a80217963fa lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp Thu Jan 15 17:54:41 2009 +0100 +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.cpp Fri Jan 16 15:52:02 2009 +0100 @@ -100,16 +100,16 @@ case WM_ERASEBKGND: return 0; - case WM_SETCURSOR: - { - SEnvMapper* envm = getEnvMapperFromHWnd(hWnd); - if (envm && !envm->irrDev->getWin32CursorControl()->isVisible()) - { - SetCursor(NULL); - return 0; - } - } - break; +// case WM_SETCURSOR: +// { +// SEnvMapper* envm = getEnvMapperFromHWnd(hWnd); +// if (envm && !envm->irrDev->getWin32CursorControl()->isVisible()) +// { +// SetCursor(NULL); +// return 0; +// } +// } +// break; case WM_MOUSEWHEEL: event.EventType = irr::EET_MOUSE_INPUT_EVENT; diff -r 3a80217963fa lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.h --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.h Thu Jan 15 17:54:41 2009 +0100 +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceWin32.h Fri Jan 16 15:52:02 2009 +0100 @@ -99,9 +99,33 @@ //! Changes the visible state of the mouse cursor. virtual void setVisible(bool visible) { - IsVisible = visible; - updateInternalCursorPosition(); - setPosition(CursorPos.X, CursorPos.Y); + CURSORINFO info; + info.cbSize = sizeof(CURSORINFO); + + if ( visible ) + { + while ( GetCursorInfo(&info) ) + { + if ( info.flags == CURSOR_SHOWING ) + { + IsVisible = visible; + break; + } + ShowCursor(true); // this only increases an internal display counter in windows, so it might have to be called some more + } + } + else + { + while ( GetCursorInfo(&info) ) + { + if ( info.flags == 0 ) // cursor hidden + { + IsVisible = visible; + break; + } + ShowCursor(false); // this only decreases an internal display counter in windows, so it might have to be called some more + } + } } //! Returns if the cursor is currently visible.