new native matrix implementation
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
28
components/led-manager/include/Matrix.h
Normal file
28
components/led-manager/include/Matrix.h
Normal 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;
|
||||
};
|
Reference in New Issue
Block a user