Make sure setVisible for Windows cursor also works while mousebutton is pressed.
As reported in http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=25880&highlight= git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2400 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
cc4ff80fa3
commit
c4f0e9b558
|
@ -177,16 +177,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
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_KEYDOWN:
|
||||
case WM_KEYUP:
|
||||
{
|
||||
|
|
|
@ -106,13 +106,34 @@ namespace irr
|
|||
//! Changes the visible state of the mouse cursor.
|
||||
virtual void setVisible(bool visible)
|
||||
{
|
||||
if(visible != IsVisible)
|
||||
CURSORINFO info;
|
||||
info.cbSize = sizeof(CURSORINFO);
|
||||
|
||||
if ( visible )
|
||||
{
|
||||
IsVisible = visible;
|
||||
updateInternalCursorPosition();
|
||||
setPosition(CursorPos.X, CursorPos.Y);
|
||||
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.
|
||||
virtual bool isVisible() const
|
||||
|
|
Loading…
Reference in New Issue