mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-16 00:08:15 +00:00
Change the color of the FPS display if the FPS is low (orange for <30, red for < 15). (#1676)
Co-authored-by: Jeffery Myers <JefMyers@blizzard.com>
This commit is contained in:
@@ -817,7 +817,13 @@ void UnloadFont(Font font)
|
|||||||
// NOTE: Uses default font
|
// NOTE: Uses default font
|
||||||
void DrawFPS(int posX, int posY)
|
void DrawFPS(int posX, int posY)
|
||||||
{
|
{
|
||||||
DrawText(TextFormat("%2i FPS", GetFPS()), posX, posY, 20, LIME);
|
Color color = LIME; // good fps
|
||||||
|
int fps = GetFPS();
|
||||||
|
|
||||||
|
if (fps < 30 && fps >= 15) color = ORANGE; // warning FPS
|
||||||
|
else if (fps < 15) color = RED; // bad FPS
|
||||||
|
|
||||||
|
DrawText(TextFormat("%2i FPS", GetFPS()), posX, posY, 20, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw text (using default font)
|
// Draw text (using default font)
|
||||||
|
Reference in New Issue
Block a user