Draw FPS
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
|
||||
void uiConsoleRender(const tileset_t *tileset, texture_t *texture) {
|
||||
if(!CONSOLE.visible) return;
|
||||
consolePrint("Test\n");
|
||||
|
||||
int32_t i = CONSOLE_HISTORY_MAX - 1;
|
||||
char_t *line;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "console/console.h"
|
||||
#include "util/string.h"
|
||||
#include "ui/uitext.h"
|
||||
#include "display/framebuffer/framebuffer.h"
|
||||
|
||||
void uiFPSRender(const tileset_t *tileset, texture_t *texture) {
|
||||
if(stringCompare(consoleVarGet("fps")->value, "0") == 0) {
|
||||
@@ -31,6 +32,11 @@ void uiFPSRender(const tileset_t *tileset, texture_t *texture) {
|
||||
fps >= 30.0f ? COLOR_YELLOW :
|
||||
COLOR_RED
|
||||
);
|
||||
|
||||
uiTextDraw(0, 0, buffer, color, tileset, texture);
|
||||
|
||||
int32_t w, h;
|
||||
uiTextMeasure(buffer, tileset, &w, &h);
|
||||
uiTextDraw(
|
||||
frameBufferGetWidth(FRAMEBUFFER_BOUND) - w, 0,
|
||||
buffer, color, tileset, texture
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user