diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-12-01 18:00:02 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-12-01 18:00:02 +0800 |
| commit | 385ce034dc775011e6fa78abc57415332c62f9e0 (patch) | |
| tree | ccfe735ffc4eebe69b33f1bb5d46fb6756404aa5 /src/platform/gui/sdl | |
| parent | a9e3b3ee511f563d1abb67cbe042c3aeb0eca5db (diff) | |
| download | cru-385ce034dc775011e6fa78abc57415332c62f9e0.tar.gz cru-385ce034dc775011e6fa78abc57415332c62f9e0.tar.bz2 cru-385ce034dc775011e6fa78abc57415332c62f9e0.zip | |
Impl sdl window GetMousePosition.
Diffstat (limited to 'src/platform/gui/sdl')
| -rw-r--r-- | src/platform/gui/sdl/Window.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/platform/gui/sdl/Window.cpp b/src/platform/gui/sdl/Window.cpp index a4dea5ad..f106b1e4 100644 --- a/src/platform/gui/sdl/Window.cpp +++ b/src/platform/gui/sdl/Window.cpp @@ -143,7 +143,11 @@ bool SdlWindow::RequestFocus() { return result; } -Point SdlWindow::GetMousePosition() { NotImplemented(); } +Point SdlWindow::GetMousePosition() { + float x, y; + SDL_GetGlobalMouseState(&x, &y); + return {x - client_rect_.left, y - client_rect_.top}; +} bool SdlWindow::CaptureMouse() { if (!sdl_window_) return false; |
