Skip to content

Commit 9cb35b4

Browse files
author
Pavel Kovalenko
committed
Clip cursor in windowed mode with enabled input capture.
1 parent 91ae69c commit 9cb35b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/xrGame/UICursor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "ui/UIStatic.h"
55
#include "ui/UIBtnHint.h"
66
#include "xrEngine/IInputReceiver.h"
7+
#include "xrEngine/xr_input.h"
78

89
#define C_DEFAULT D3DCOLOR_XRGB(0xff,0xff,0xff)
910

@@ -113,6 +114,8 @@ void CUICursor::UpdateCursorPosition(int _dx, int _dy)
113114
}
114115
clamp (vPos.x, 0.f, UI_BASE_WIDTH);
115116
clamp (vPos.y, 0.f, UI_BASE_HEIGHT);
117+
if (m_b_use_win_cursor && pInput->get_exclusive_mode())
118+
SetUICursorPosition(vPos);
116119
}
117120

118121
void CUICursor::SetUICursorPosition(Fvector2 pos)

0 commit comments

Comments
 (0)