Add crosshairs mouse cursor

This commit is contained in:
Jack Andersen 2016-01-09 20:42:00 -10:00
parent 5485e7d2b1
commit f20c1bcfc2
8 changed files with 13 additions and 1 deletions

View File

@ -241,7 +241,8 @@ enum class EMouseCursor
Pointer = 1,
HorizontalArrow = 2,
VerticalArrow = 3,
IBeam = 4
IBeam = 4,
Crosshairs = 5
};
enum class EClipboardType

View File

@ -1309,6 +1309,9 @@ public:
case EMouseCursor::IBeam:
[[NSCursor IBeamCursor] set];
break;
case EMouseCursor::Crosshairs:
[[NSCursor crosshairCursor] set];
break;
default: break;
}
});

View File

@ -97,6 +97,7 @@ public:
WIN32_CURSORS.m_hResize = LoadCursor(nullptr, IDC_SIZEWE);
WIN32_CURSORS.m_vResize = LoadCursor(nullptr, IDC_SIZENS);
WIN32_CURSORS.m_ibeam = LoadCursor(nullptr, IDC_IBEAM);
WIN32_CURSORS.m_crosshairs = LoadCursor(nullptr, IDC_CROSS);
WIN32_CURSORS.m_wait = LoadCursor(nullptr, IDC_WAIT);
HMODULE dxgilib = LoadLibraryW(L"dxgi.dll");

View File

@ -261,6 +261,7 @@ struct Win32Cursors
HCURSOR m_hResize;
HCURSOR m_vResize;
HCURSOR m_ibeam;
HCURSOR m_crosshairs;
HCURSOR m_wait;
};
namespace boo

View File

@ -698,6 +698,8 @@ class WindowWin32 : public IWindow
return WIN32_CURSORS.m_vResize;
case EMouseCursor::IBeam:
return WIN32_CURSORS.m_ibeam;
case EMouseCursor::Crosshairs:
return WIN32_CURSORS.m_crosshairs;
default: break;
}
return WIN32_CURSORS.m_arrow;

View File

@ -302,6 +302,7 @@ public:
X_CURSORS.m_hArrow = XCreateFontCursor(m_xDisp, XC_sb_h_double_arrow);
X_CURSORS.m_vArrow = XCreateFontCursor(m_xDisp, XC_sb_v_double_arrow);
X_CURSORS.m_ibeam = XCreateFontCursor(m_xDisp, XC_xterm);
X_CURSORS.m_crosshairs = XCreateFontCursor(m_xDisp, XC_cross);
X_CURSORS.m_wait = XCreateFontCursor(m_xDisp, XC_watch);
/* The xkb extension requests that the X server does not

View File

@ -547,6 +547,8 @@ class WindowXlib : public IWindow
return X_CURSORS.m_vArrow;
case EMouseCursor::IBeam:
return X_CURSORS.m_ibeam;
case EMouseCursor::Crosshairs:
return X_CURSORS.m_crosshairs;
default: break;
}
return X_CURSORS.m_pointer;

View File

@ -12,6 +12,7 @@ struct XlibCursors
Cursor m_hArrow;
Cursor m_vArrow;
Cursor m_ibeam;
Cursor m_crosshairs;
Cursor m_wait;
};
extern XlibCursors X_CURSORS;