mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[wpigui] Limit frame rate to 120 fps by default (#5030)
Limiting with vsync is apparently unreliable on a number of systems; this resulted in high CPU/GPU usage. Also add current actual frame rate to about dialog of GUI tools.
This commit is contained in:
@@ -162,6 +162,13 @@ enum Style { kStyleClassic = 0, kStyleDark, kStyleLight };
|
||||
*/
|
||||
void SetStyle(Style style);
|
||||
|
||||
/**
|
||||
* Sets the FPS limit. Using this function makes this setting persistent.
|
||||
*
|
||||
* @param fps FPS (0=vsync)
|
||||
*/
|
||||
void SetFPS(int fps);
|
||||
|
||||
/**
|
||||
* Sets the clear (background) color.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,7 @@ struct SavedSettings {
|
||||
int yPos = -1;
|
||||
int userScale = 2;
|
||||
int style = 0;
|
||||
int fps = 120;
|
||||
};
|
||||
|
||||
constexpr int kFontScaledLevels = 9;
|
||||
|
||||
Reference in New Issue
Block a user