feat: window and input handling

This commit is contained in:
DarthMooMancer
2025-09-01 00:46:11 -04:00
parent 0d215201fc
commit 6cb55e0e1a
7 changed files with 82 additions and 3 deletions
+19
View File
@@ -0,0 +1,19 @@
#include "window.hpp"
#include <iostream>
#include <chrono>
#include <thread>
void Window::update_display() {
for(std::array<char, COL> &row : m_board) { row.fill('.'); }
// Modify board
// Refresh and draw screen
std::cout << "\033[H" << std::flush;
for(std::array<char, COL> &row : m_board) {
for(char &col : row) {
std::cout << col << " ";
}
std::cout << "\r\n";
}
std::this_thread::sleep_for(std::chrono::milliseconds(130)); // 1000 / fps; 200ms = 5fps
}