mirror of
https://github.com/libretro/RetroArch
synced 2025-04-15 23:42:30 +00:00
Add RARCH_DISPLAY_CTL_SHOW_MOUSE
This commit is contained in:
parent
3e986f9562
commit
d68401aa4d
@ -1760,6 +1760,7 @@ bool event_command(enum event_command cmd)
|
|||||||
case EVENT_CMD_GRAB_MOUSE_TOGGLE:
|
case EVENT_CMD_GRAB_MOUSE_TOGGLE:
|
||||||
{
|
{
|
||||||
static bool grab_mouse_state = false;
|
static bool grab_mouse_state = false;
|
||||||
|
bool grab_mouse_state_tmp;
|
||||||
|
|
||||||
grab_mouse_state = !grab_mouse_state;
|
grab_mouse_state = !grab_mouse_state;
|
||||||
|
|
||||||
@ -1770,7 +1771,8 @@ bool event_command(enum event_command cmd)
|
|||||||
msg_hash_to_str(MSG_GRAB_MOUSE_STATE),
|
msg_hash_to_str(MSG_GRAB_MOUSE_STATE),
|
||||||
grab_mouse_state ? "yes" : "no");
|
grab_mouse_state ? "yes" : "no");
|
||||||
|
|
||||||
video_driver_show_mouse(!grab_mouse_state);
|
grab_mouse_state_tmp = !grab_mouse_state;
|
||||||
|
video_driver_ctl(RARCH_DISPLAY_CTL_SHOW_MOUSE, &grab_mouse_state_tmp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG:
|
case EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG:
|
||||||
|
@ -653,14 +653,6 @@ void video_driver_set_aspect_ratio(unsigned aspectratio_index)
|
|||||||
poke->set_aspect_ratio(driver->video_data, aspectratio_index);
|
poke->set_aspect_ratio(driver->video_data, aspectratio_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void video_driver_show_mouse(bool state)
|
|
||||||
{
|
|
||||||
driver_t *driver = driver_get_ptr();
|
|
||||||
const video_poke_interface_t *poke = video_driver_get_poke_ptr(driver);
|
|
||||||
|
|
||||||
if (poke && poke->show_mouse)
|
|
||||||
poke->show_mouse(driver->video_data, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
void video_driver_set_osd_msg(const char *msg,
|
void video_driver_set_osd_msg(const char *msg,
|
||||||
const struct font_params *params, void *font)
|
const struct font_params *params, void *font)
|
||||||
@ -1157,6 +1149,16 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
|
|||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
|
case RARCH_DISPLAY_CTL_SHOW_MOUSE:
|
||||||
|
{
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
const video_poke_interface_t *poke = video_driver_get_poke_ptr(driver);
|
||||||
|
bool *toggle = (bool*)data;
|
||||||
|
|
||||||
|
if (poke && poke->show_mouse)
|
||||||
|
poke->show_mouse(driver->video_data, *toggle);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
case RARCH_DISPLAY_CTL_SET_NONBLOCK_STATE:
|
case RARCH_DISPLAY_CTL_SET_NONBLOCK_STATE:
|
||||||
{
|
{
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
|
@ -232,6 +232,7 @@ enum rarch_display_ctl_state
|
|||||||
/* Renders the current video frame. */
|
/* Renders the current video frame. */
|
||||||
RARCH_DISPLAY_CTL_CACHED_FRAME_RENDER,
|
RARCH_DISPLAY_CTL_CACHED_FRAME_RENDER,
|
||||||
RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB,
|
RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB,
|
||||||
|
RARCH_DISPLAY_CTL_SHOW_MOUSE,
|
||||||
RARCH_DISPLAY_CTL_GET_FRAME_COUNT
|
RARCH_DISPLAY_CTL_GET_FRAME_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -304,8 +305,6 @@ bool video_driver_get_video_output_size(
|
|||||||
|
|
||||||
void video_driver_set_aspect_ratio(unsigned aspectratio_index);
|
void video_driver_set_aspect_ratio(unsigned aspectratio_index);
|
||||||
|
|
||||||
void video_driver_show_mouse(bool state);
|
|
||||||
|
|
||||||
void video_driver_set_osd_msg(const char *msg,
|
void video_driver_set_osd_msg(const char *msg,
|
||||||
const struct font_params *params, void *font);
|
const struct font_params *params, void *font);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user