[client] app: add keybind to toggle frame timing information display

This commit is contained in:
Geoffrey McRae 2021-07-18 09:59:37 +10:00
parent 73357988e6
commit df2f623599
3 changed files with 10 additions and 0 deletions

View File

@ -642,6 +642,9 @@ bool rbCalcMetrics(int index, float * value, float * udata)
bool app_renderImGui(void)
{
if (!g_state.showTiming)
return false;
igNewFrame();
ImGuiStyle * style = igGetStyle();

View File

@ -54,6 +54,11 @@ static void bind_showFPS(int sc, void * opaque)
app_showFPS(g_state.showFPS);
}
static void bind_showTiming(int sc, void * opaque)
{
g_state.showTiming = !g_state.showTiming;
}
static void bind_rotate(int sc, void * opaque)
{
if (g_params.winRotate == LG_ROTATE_MAX-1)
@ -134,6 +139,7 @@ void keybind_register(void)
app_registerKeybind(KEY_F, bind_fullscreen, NULL, "Full screen toggle");
app_registerKeybind(KEY_V, bind_video , NULL, "Video stream toggle");
app_registerKeybind(KEY_D, bind_showFPS , NULL, "FPS display toggle");
app_registerKeybind(KEY_T, bind_showTiming, NULL, "Show frame timing information");
app_registerKeybind(KEY_R, bind_rotate , NULL, "Rotate the output clockwise by 90° increments");
app_registerKeybind(KEY_Q, bind_quit , NULL, "Quit");

View File

@ -55,6 +55,7 @@ struct AppState
bool stopVideo;
bool ignoreInput;
bool showFPS;
bool showTiming;
bool escapeActive;
uint64_t escapeTime;
int escapeAction;