mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Add config option for reduced render rate.
This commit is contained in:
parent
547325f270
commit
c21170cc01
@ -211,6 +211,7 @@ static void LoadConfig()
|
||||
|
||||
int v;
|
||||
if( ini_sget( ini, "core", "threadedRendering", "%d", &v ) ) s_config.threadedRendering = v;
|
||||
if( ini_sget( ini, "core", "focusLostLimit", "%d", &v ) ) s_config.focusLostLimit = v;
|
||||
if( ini_sget( ini, "timeline", "targetFps", "%d", &v ) && v >= 1 && v < 10000 ) s_config.targetFps = v;
|
||||
|
||||
ini_free( ini );
|
||||
@ -224,6 +225,7 @@ static bool SaveConfig()
|
||||
|
||||
fprintf( f, "[core]\n" );
|
||||
fprintf( f, "threadedRendering = %i\n", (int)s_config.threadedRendering );
|
||||
fprintf( f, "focusLostLimit = %i\n", (int)s_config.focusLostLimit );
|
||||
|
||||
fprintf( f, "\n[timeline]\n" );
|
||||
fprintf( f, "targetFps = %i\n", s_config.targetFps );
|
||||
@ -658,6 +660,9 @@ static void DrawContents()
|
||||
tracy::DrawHelpMarker( "Restricts rendering to a single CPU core. Can reduce profiler frame rate." );
|
||||
ImGui::Unindent();
|
||||
|
||||
ImGui::Spacing();
|
||||
if( ImGui::Checkbox( "Reduce render rate when focus is lost", &s_config.focusLostLimit ) ) SaveConfig();
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::TextUnformatted( "Target FPS" );
|
||||
ImGui::SameLine();
|
||||
|
@ -7,6 +7,7 @@ namespace tracy
|
||||
struct Config
|
||||
{
|
||||
bool threadedRendering = true;
|
||||
bool focusLostLimit = true;
|
||||
int targetFps = 60;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user