MCPcopy Create free account
hub / github.com/ddnet/ddnet / OnCursorMove

Method OnCursorMove

src/game/client/ui.cpp:172–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172void CUi::OnCursorMove(float X, float Y)
173{
174 if(!CheckMouseLock())
175 {
176 m_UpdatedMousePos.x = std::clamp(m_UpdatedMousePos.x + X, 0.0f, Graphics()->WindowWidth() - 1.0f);
177 m_UpdatedMousePos.y = std::clamp(m_UpdatedMousePos.y + Y, 0.0f, Graphics()->WindowHeight() - 1.0f);
178 }
179
180 m_UpdatedMouseDelta += vec2(X, Y);
181}
182
183void CUi::Update(vec2 MouseWorldPos)
184{

Callers 2

OnUpdateMethod · 0.45
OnUpdateMethod · 0.45

Calls 3

GraphicsFunction · 0.85
WindowWidthMethod · 0.80
WindowHeightMethod · 0.80

Tested by

no test coverage detected