mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
Add UWP implementation for cursor methods
This commit is contained in:
parent
97f953f0a5
commit
ee6872dc68
2 changed files with 41 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -143,6 +143,11 @@ private:
|
|||
void set_fullscreen(int fullscreen);
|
||||
|
||||
static POINT s_saved_cursor_pos;
|
||||
|
||||
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
static Windows::UI::Core::CoreCursor^ s_cursor;
|
||||
#endif
|
||||
|
||||
running_machine & m_machine;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue