MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / UpdateCursor

Method UpdateCursor

Source/Engine/Platform/Windows/WindowsWindow.cpp:741–837  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

739}
740
741void WindowsWindow::UpdateCursor()
742{
743 // Don't hide cursor when window is not focused
744 if (_cursor == CursorType::Hidden && _focused)
745 {
746 if (!_lastCursorHidden)
747 {
748 _lastCursorHidden = true;
749 while(::ShowCursor(FALSE) >= 0)
750 {
751 if (_cursorHiddenSafetyCount >= 100)
752 {
753 LOG(Warning, "Cursor has failed to hide.");
754 break;
755 }
756 _cursorHiddenSafetyCount += 1;
757 }
758 _cursorHiddenSafetyCount = 0;
759 }
760 ::SetCursor(nullptr);
761 return;
762 }
763 else if (_lastCursorHidden)
764 {
765 _lastCursorHidden = false;
766 while(::ShowCursor(TRUE) < 0)
767 {
768 if (_cursorHiddenSafetyCount >= 100)
769 {
770 LOG(Warning, "Cursor has failed to show.");
771 break;
772 }
773 _cursorHiddenSafetyCount += 1;
774 }
775 _cursorHiddenSafetyCount = 0;
776 }
777
778 int32 index = 0;
779 switch (_cursor)
780 {
781 case CursorType::Default:
782 break;
783 case CursorType::Cross:
784 index = 1;
785 break;
786 case CursorType::Hand:
787 index = 2;
788 break;
789 case CursorType::Help:
790 index = 3;
791 break;
792 case CursorType::IBeam:
793 index = 4;
794 break;
795 case CursorType::No:
796 index = 5;
797 break;
798 case CursorType::Wait:

Callers

nothing calls this directly

Calls 1

SetCursorFunction · 0.85

Tested by

no test coverage detected