new native matrix implementation

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-06-22 18:16:48 +02:00
parent 0b65ac198f
commit c6f0c4572d
12 changed files with 137 additions and 95 deletions

View File

@@ -0,0 +1,28 @@
#pragma once
#include "SDL3/SDL_render.h"
#include <cstdint>
class Matrix
{
public:
explicit Matrix(SDL_WindowID windowId, SDL_Renderer *renderer, uint8_t cols, uint8_t rows);
[[nodiscard]] SDL_Renderer *renderer() const;
void Render() const;
SDL_WindowID windowId() const;
private:
void DrawColoredGrid() const;
SDL_WindowID m_windowId;
SDL_Renderer *m_renderer;
uint8_t m_cols;
uint8_t m_rows;
static constexpr float cellSize = 50.0f;
static constexpr float spacing = 1.0f;
};