mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 04:43:53 +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;
|
int v;
|
||||||
if( ini_sget( ini, "core", "threadedRendering", "%d", &v ) ) s_config.threadedRendering = 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;
|
if( ini_sget( ini, "timeline", "targetFps", "%d", &v ) && v >= 1 && v < 10000 ) s_config.targetFps = v;
|
||||||
|
|
||||||
ini_free( ini );
|
ini_free( ini );
|
||||||
@ -224,6 +225,7 @@ static bool SaveConfig()
|
|||||||
|
|
||||||
fprintf( f, "[core]\n" );
|
fprintf( f, "[core]\n" );
|
||||||
fprintf( f, "threadedRendering = %i\n", (int)s_config.threadedRendering );
|
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, "\n[timeline]\n" );
|
||||||
fprintf( f, "targetFps = %i\n", s_config.targetFps );
|
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." );
|
tracy::DrawHelpMarker( "Restricts rendering to a single CPU core. Can reduce profiler frame rate." );
|
||||||
ImGui::Unindent();
|
ImGui::Unindent();
|
||||||
|
|
||||||
|
ImGui::Spacing();
|
||||||
|
if( ImGui::Checkbox( "Reduce render rate when focus is lost", &s_config.focusLostLimit ) ) SaveConfig();
|
||||||
|
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
ImGui::TextUnformatted( "Target FPS" );
|
ImGui::TextUnformatted( "Target FPS" );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
@ -7,6 +7,7 @@ namespace tracy
|
|||||||
struct Config
|
struct Config
|
||||||
{
|
{
|
||||||
bool threadedRendering = true;
|
bool threadedRendering = true;
|
||||||
|
bool focusLostLimit = true;
|
||||||
int targetFps = 60;
|
int targetFps = 60;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user