static int fs_emu_get_netplay_input_event() { fs_mutex_lock(g_input_event_mutex); int input_event = FS_POINTER_TO_INT(g_queue_pop_tail( g_input_event_queue)); fs_mutex_unlock(g_input_event_mutex); return input_event; }
static void process_video_events() { fs_mutex_lock(g_video_event_mutex); int count = g_queue_get_length(g_video_event_queue); for (int i = 0; i < count; i++) { int event = FS_POINTER_TO_INT(g_queue_pop_tail(g_video_event_queue)); if (event == FS_ML_VIDEO_EVENT_GRAB_INPUT) { fs_ml_grab_input(1, 1); } else if (event == FS_ML_VIDEO_EVENT_UNGRAB_INPUT) { fs_ml_grab_input(0, 1); } else if (event == FS_ML_VIDEO_EVENT_SHOW_CURSOR) { fs_ml_show_cursor(1, 1); } else if (event == FS_ML_VIDEO_EVENT_HIDE_CURSOR) { fs_ml_show_cursor(0, 1); } } fs_mutex_unlock(g_video_event_mutex); }
static void process_video_events(void) { fs_mutex_lock(g_video_event_mutex); int count = g_queue_get_length(g_video_event_queue); for (int i = 0; i < count; i++) { int event = FS_POINTER_TO_INT(g_queue_pop_tail(g_video_event_queue)); if (event == FS_ML_VIDEO_EVENT_GRAB_INPUT) { fs_ml_set_input_grab(true); } else if (event == FS_ML_VIDEO_EVENT_UNGRAB_INPUT) { fs_ml_set_input_grab(false); } else if (event == FS_ML_VIDEO_EVENT_SHOW_CURSOR) { fs_ml_show_cursor(1, 1); } else if (event == FS_ML_VIDEO_EVENT_HIDE_CURSOR) { fs_ml_show_cursor(0, 1); } else if (event == FS_ML_VIDEO_EVENT_TOGGLE_FULLSCREEN) { fs_ml_toggle_fullscreen(); } else if (event == FS_ML_VIDEO_EVENT_ENABLE_FULLSCREEN) { fs_ml_set_fullscreen(true); } else if (event == FS_ML_VIDEO_EVENT_DISABLE_FULLSCREEN) { fs_ml_set_fullscreen(false); } } fs_mutex_unlock(g_video_event_mutex); }