diff options
| author | 2016-04-18 19:05:45 -0400 | |
|---|---|---|
| committer | 2016-04-18 19:05:45 -0400 | |
| commit | ee6872dc68ba2dfc3834ec91dd97f98ce2cc4302 (patch) | |
| tree | 3e70bbfb826e2918f16dcfc389ca366976cd9aad /src/osd/windows/window.cpp | |
| parent | 97f953f0a5def5b6acc34e40244e7c293589c03f (diff) | |
Add UWP implementation for cursor methods
Diffstat (limited to 'src/osd/windows/window.cpp')
| -rw-r--r-- | src/osd/windows/window.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index 1c3c2a8ec23..1bae62625f3 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -30,6 +30,11 @@ #include "winutil.h" +#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +#include <agile.h> +using namespace Windows::UI::Core; +#endif + #include "modules/render/drawbgfx.h" #include "modules/render/drawnone.h" #include "modules/render/drawd3d.h" @@ -385,6 +390,8 @@ win_window_info::~win_window_info() POINT win_window_info::s_saved_cursor_pos = { -1, -1 }; +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + void win_window_info::capture_pointer() { RECT bounds; @@ -419,6 +426,35 @@ void win_window_info::show_pointer() ShowCursor(FALSE); } +#else + +CoreCursor^ win_window_info::s_cursor = nullptr; + +void win_window_info::capture_pointer() +{ + platform_window<Platform::Agile<CoreWindow^>>()->SetPointerCapture(); +} + +void win_window_info::release_pointer() +{ + platform_window<Platform::Agile<CoreWindow^>>()->ReleasePointerCapture(); +} + +void win_window_info::hide_pointer() +{ + auto window = platform_window<Platform::Agile<CoreWindow^>>(); + win_window_info::s_cursor = window->PointerCursor; + window->PointerCursor = nullptr; +} + +void win_window_info::show_pointer() +{ + auto window = platform_window<Platform::Agile<CoreWindow^>>(); + window->PointerCursor = win_window_info::s_cursor; +} + +#endif + //============================================================ // winwindow_process_events_periodic // (main thread) |
