Added a menu toggle item at Advanced > UI > Show FPS to show fps as an ui element. The related Debug Setting is: SLBShowFPS

This commit is contained in:
Salvatore La Bua
2013-09-22 00:11:54 +02:00
parent 992d8e960c
commit df6aa397f9
3 changed files with 19 additions and 0 deletions

View File

@@ -846,6 +846,17 @@ Found in Advanced->Rendering->Info Displays</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>SLBShowFPS</key>
<map>
<key>Comment</key>
<string>Show FPS</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>LogShowHistoryLines</key>
<map>
<key>Comment</key>

View File

@@ -1204,6 +1204,7 @@ void init_debug_ui_menu(LLMenuGL* menu)
menu->addChild(new LLMenuItemCheckGL("Show Render Info", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderInfo"));
menu->addChild(new LLMenuItemCheckGL("Show Matrices", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderMatrices"));
menu->addChild(new LLMenuItemCheckGL("Show Color Under Cursor", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowColor"));
menu->addChild(new LLMenuItemCheckGL("Show FPS", menu_toggle_control, NULL, menu_check_control, (void*)"SLBShowFPS"));
menu->createJumpKeys();
}

View File

@@ -729,6 +729,13 @@ public:
ypos += y_inc;
}
static const LLCachedControl<bool> slb_show_fps("SLBShowFPS");
if (slb_show_fps)
{
addText(xpos+280, ypos+5, llformat("FPS %3.1f", LLViewerStats::getInstance()->mFPSStat.getMeanPerSec()));
ypos += y_inc;
}
static const LLCachedControl<bool> DebugShowPrivateMem("DebugShowPrivateMem",false);
if (DebugShowPrivateMem)
{