Time stuff

This commit is contained in:
2025-08-17 16:11:22 -05:00
parent 6d6a0e4886
commit 3d4317260f
20 changed files with 176 additions and 17 deletions

View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "renderfps.h"
#include "display/ui/rendertext.h"
#include "time.h"
void renderFPSDraw(void) {
float_t fps = 1.0f / TIME.delta;
char_t buffer[32];
snprintf(buffer, sizeof(buffer), "FPS: %.1f", fps);
if(fps >= 50.0f) {
// Green
renderTextDraw(0, 0, buffer, 0x00, 0xFF, 0x00);
} else if(fps >= 30.0f) {
// Yellow
renderTextDraw(0, 0, buffer, 0xFF, 0xFF, 0x00);
} else {
// Red
renderTextDraw(0, 0, buffer, 0xFF, 0x00, 0x00);
}
}