Skip to content

Commit

Permalink
Clip cursor in windowed mode with enabled input capture.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kovalenko committed Oct 11, 2014
1 parent 91ae69c commit 9cb35b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xrGame/UICursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "ui/UIStatic.h"
#include "ui/UIBtnHint.h"
#include "xrEngine/IInputReceiver.h"
#include "xrEngine/xr_input.h"

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

Expand Down Expand Up @@ -113,6 +114,8 @@ void CUICursor::UpdateCursorPosition(int _dx, int _dy)
}
clamp (vPos.x, 0.f, UI_BASE_WIDTH);
clamp (vPos.y, 0.f, UI_BASE_HEIGHT);
if (m_b_use_win_cursor && pInput->get_exclusive_mode())
SetUICursorPosition(vPos);
}

void CUICursor::SetUICursorPosition(Fvector2 pos)
Expand Down

0 comments on commit 9cb35b4

Please sign in to comment.