Draw FPS
This commit is contained in:
48
src/game/minesweeper/ui/ui.c
Normal file
48
src/game/minesweeper/ui/ui.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "ui.h"
|
||||
#include "ui/uifps.h"
|
||||
#include "ui/uiconsole.h"
|
||||
#include "display/framebuffer/framebuffer.h"
|
||||
|
||||
#include "display/tileset/tileset_minogram.h"
|
||||
|
||||
ui_t UI;
|
||||
|
||||
void uiInit(void) {
|
||||
cameraInitOrthographic(&UI.camera);
|
||||
|
||||
UI.minogramTileset = (tileset_t*)&TILESET_MINOGRAM;
|
||||
|
||||
assetManagerLoadAsset(
|
||||
UI.minogramTileset->image,
|
||||
&UI.minogramAsset,
|
||||
&UI.minogramRef
|
||||
);
|
||||
}
|
||||
|
||||
void uiRender(void) {
|
||||
int32_t w = frameBufferGetWidth(FRAMEBUFFER_BOUND);
|
||||
int32_t h = frameBufferGetHeight(FRAMEBUFFER_BOUND);
|
||||
|
||||
UI.camera.orthographic.left = 0;
|
||||
UI.camera.orthographic.right = w;
|
||||
UI.camera.orthographic.bottom = h;
|
||||
UI.camera.orthographic.top = 0;
|
||||
|
||||
cameraPushMatrix(&UI.camera);
|
||||
|
||||
uiFPSRender(UI.minogramTileset, &UI.minogramAsset->alphaImage.texture);
|
||||
uiConsoleRender(UI.minogramTileset, &UI.minogramAsset->alphaImage.texture);
|
||||
|
||||
cameraPopMatrix();
|
||||
}
|
||||
|
||||
void uiDispose(void) {
|
||||
|
||||
}
|
Reference in New Issue
Block a user