While processing the WM_SETCURSOR windows message I call SetCursor to a certain cursor. If I set the cursor to something different then what it is, it waits until the mouse gets input via moving or clicking to actually set it.
Is there a way to counter this so the cursor doesn't visually look wrong until the cursor takes input?
case WM_SETCURSOR:
{
SetCursor( game->GetCursor() ); // Returns m_curCurrent
return true;
}
break;
I also Set the cursor type when I want it to change.
During initialization of game:
m_curDefault = LoadCursor( m_hInstance, MAKEINTRESOURCE( IDC_DEFAULT_CURSOR ));
m_curAttack = LoadCursor( m_hInstance, MAKEINTRESOURCE( IDC_ATTACK_CURSOR ));
m_curMove = LoadCursor( m_hInstance, MAKEINTRESOURCE( IDC_MOVE_CURSOR ));
m_curCurrent = m_curDefault;
When setting Cursor type
void Game::SetCursorType( CursorTypes curType )
{
switch ( curType )
{
case CGame::DefaultCursor:
m_curCurrent = m_curDefault;
break;
case CGame::AttackCursor:
m_curCurrent = m_curAttack;
break;
case CGame::MoveCursor:
m_curCurrent = m_curMove;
break;
default:
break;
}
}