MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / SetMousePosition

Method SetMousePosition

Source/Engine/Platform/SDL/SDLInput.cpp:384–397  ·  view source on GitHub ↗

[Mouse]

Source from the content-addressed store, hash-verified

382
383 // [Mouse]
384 void SetMousePosition(const Float2& screenPosition) final override
385 {
386#if USE_EDITOR
387 auto window = Editor::Managed->GetGameWindow();
388 if (window == nullptr)
389 window = Engine::MainWindow;
390#else
391 auto window = Engine::MainWindow;
392#endif
393 Float2 position = window->ScreenToClient(screenPosition);
394 SDL_WarpMouseInWindow(static_cast<SDLWindow*>(window)->_window, position.X, position.Y);
395
396 OnMouseMoved(screenPosition);
397 }
398
399 void SetRelativeMode(bool relativeMode, Window* window) final override
400 {

Callers

nothing calls this directly

Calls 3

OnMouseMovedFunction · 0.85
GetGameWindowMethod · 0.80
ScreenToClientMethod · 0.45

Tested by

no test coverage detected