Can update video refresh rate from RGUI.

This commit is contained in:
Themaister 2013-06-07 14:34:09 +02:00
parent d8d9073f30
commit d5a8d3bfb0
2 changed files with 19 additions and 1 deletions

View File

@ -266,7 +266,11 @@ static void adjust_system_rates(void)
void driver_set_monitor_refresh_rate(float hz)
{
RARCH_LOG("Setting refresh rate to: %.2fHz.\n", hz);
char msg[256];
snprintf(msg, sizeof(msg), "Setting refresh rate to: %.3f Hz.", hz);
msg_queue_push(g_extern.msg_queue, msg, 1, 180);
RARCH_LOG("%s\n", msg);
g_settings.video.refresh_rate = hz;
adjust_system_rates();

View File

@ -1973,6 +1973,20 @@ static int video_option_toggle_setting(rgui_handle_t *rgui, unsigned setting, rg
g_extern.measure_data.frame_time_samples_count = 0;
break;
case RGUI_ACTION_OK:
{
double refresh_rate = 0.0;
double deviation = 0.0;
unsigned sample_points = 0;
if (driver_monitor_fps_statistics(&refresh_rate, &deviation, &sample_points))
{
driver_set_monitor_refresh_rate(refresh_rate);
// Incase refresh rate update forced non-block video.
video_set_nonblock_state_func(false);
}
break;
}
default:
break;
}