Smallcase folders part 1

This commit is contained in:
2025-12-29 13:39:40 +00:00
parent ae48f96fe8
commit 8bef59f793
84 changed files with 40 additions and 35 deletions
+45
View File
@@ -0,0 +1,45 @@
#include "Renderer.h"
namespace display::graphics
{
Renderer::Renderer(Framebuffer &framebuffer, model::HostRegistry &registry)
: framebuffer(framebuffer),
registry(registry)
{
}
void Renderer::render()
{
framebuffer.clear(Color{0, 0, 0});
header.draw(framebuffer, textRenderer, START_X, START_Y);
int blocksPerRow =
(SCREEN_WIDTH + BLOCK_GAP) / (display::ui::hostblock::BLOCK_WIDTH + BLOCK_GAP);
if (blocksPerRow < 1)
blocksPerRow = 1;
int index = 0;
for (auto &[host, m] : registry.snapshot())
{
int col = index % blocksPerRow;
int row = index / blocksPerRow;
int x = START_X + col * (display::ui::hostblock::BLOCK_WIDTH + BLOCK_GAP);
int y = START_Y + header.height() + BLOCK_GAP + row * (display::ui::hostblock::BLOCK_HEIGHT + BLOCK_GAP);
hostblock.draw(
framebuffer,
textRenderer,
x,
y,
host,
m);
++index;
}
framebuffer.present();
}
} // namespace display::graphics