combine with desktop project

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-04-10 23:20:19 +02:00
parent b6fb4eb65c
commit b3bf03999b
72 changed files with 65538 additions and 132 deletions

43
src/model/AppContext.cpp Normal file
View File

@@ -0,0 +1,43 @@
#include "model/AppContext.h"
#include "ui/Matrix.h"
auto AppContext::window() const -> SDL_Window * {
return m_window->window();
}
auto AppContext::renderer() const -> SDL_Renderer * {
return m_window->renderer();
}
auto AppContext::surface() const -> SDL_Surface * {
return SDL_GetWindowSurface(m_window->window());
}
void AppContext::setMatrix(Matrix *matrix) {
m_matrix = matrix;
}
auto AppContext::matrix() const -> Matrix * {
return m_matrix;
}
auto AppContext::matrix_window() const -> SDL_Window * {
if (m_matrix && m_matrix->window()) {
return m_matrix->window()->window();
}
return nullptr;
}
auto AppContext::matrix_renderer() const -> SDL_Renderer * {
if (m_matrix && m_matrix->window()) {
return m_matrix->window()->renderer();
}
return nullptr;
}
void AppContext::matrix_render() const {
if (m_matrix && m_matrix->window()) {
m_matrix->render();
}
}

9
src/model/Window.cpp Normal file
View File

@@ -0,0 +1,9 @@
#include "model/Window.h"
auto Window::window() const -> SDL_Window * {
return m_window;
}
auto Window::renderer() const -> SDL_Renderer * {
return SDL_GetRenderer(m_window);
}