[UI] Capture mouse.

This commit is contained in:
Joel Linn
2020-04-20 02:16:14 +02:00
committed by Rick Gibbed
parent d1315438f3
commit 6a1c134cf3
5 changed files with 57 additions and 10 deletions

View File

@@ -236,6 +236,21 @@ bool Win32Window::SetIcon(const void* buffer, size_t size) {
return false;
}
bool Win32Window::CaptureMouse() {
if (GetCapture() != nullptr) {
return false;
}
SetCapture(hwnd_);
return true;
}
bool Win32Window::ReleaseMouse() {
if (GetCapture() != hwnd_) {
return false;
}
return ReleaseCapture() != 0;
}
bool Win32Window::is_fullscreen() const { return fullscreen_; }
// https://blogs.msdn.microsoft.com/oldnewthing/20131017-00/?p=2903