File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,36 @@ void CUICursor::OnScreenResolutionChanged()
31
31
InitInternal ();
32
32
}
33
33
34
+ void CUICursor::Clip (bool clip)
35
+ {
36
+ HWND hwnd = Device.m_hWnd ;
37
+ if (hwnd)
38
+ {
39
+ if (clip)
40
+ {
41
+ RECT clientRect;
42
+ ::GetClientRect (hwnd, &clientRect);
43
+ ::ClientToScreen (hwnd, (LPPOINT)&clientRect.left);
44
+ ::ClientToScreen (hwnd, (LPPOINT)&clientRect.right);
45
+ ::ClipCursor (&clientRect);
46
+ }
47
+ else
48
+ ::ClipCursor (nullptr );
49
+ }
50
+ }
51
+
52
+ void CUICursor::Show ()
53
+ {
54
+ bVisible = true ;
55
+ Clip (false );
56
+ }
57
+
58
+ void CUICursor::Hide ()
59
+ {
60
+ bVisible = false ;
61
+ Clip (true );
62
+ }
63
+
34
64
void CUICursor::InitInternal ()
35
65
{
36
66
m_static = xr_new<CUIStatic>();
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class CUICursor: public pureRender,
25
25
virtual void OnScreenResolutionChanged ();
26
26
27
27
bool IsVisible () {return bVisible;}
28
- void Show () {bVisible = true ;}
29
- void Hide () {bVisible = false ;}
28
+ void Show ();
29
+ void Hide ();
30
+ void Clip (bool clip);
30
31
};
You can’t perform that action at this time.
0 commit comments