mirror of
https://github.com/holub/mame
synced 2025-06-07 21:33:45 +03:00
Add UWP implementation for cursor methods
This commit is contained in:
parent
97f953f0a5
commit
ee6872dc68
@ -30,6 +30,11 @@
|
|||||||
|
|
||||||
#include "winutil.h"
|
#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/drawbgfx.h"
|
||||||
#include "modules/render/drawnone.h"
|
#include "modules/render/drawnone.h"
|
||||||
#include "modules/render/drawd3d.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 };
|
POINT win_window_info::s_saved_cursor_pos = { -1, -1 };
|
||||||
|
|
||||||
|
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||||
|
|
||||||
void win_window_info::capture_pointer()
|
void win_window_info::capture_pointer()
|
||||||
{
|
{
|
||||||
RECT bounds;
|
RECT bounds;
|
||||||
@ -419,6 +426,35 @@ void win_window_info::show_pointer()
|
|||||||
ShowCursor(FALSE);
|
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
|
// winwindow_process_events_periodic
|
||||||
// (main thread)
|
// (main thread)
|
||||||
|
@ -143,6 +143,11 @@ private:
|
|||||||
void set_fullscreen(int fullscreen);
|
void set_fullscreen(int fullscreen);
|
||||||
|
|
||||||
static POINT s_saved_cursor_pos;
|
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;
|
running_machine & m_machine;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user