From afdd12277a43d3ad7755f028e85c569dece84f0b Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Tue, 8 Oct 2024 15:43:45 +0200 Subject: rendering system --- src/crepe/api/game.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'src/crepe/api/game.cpp') diff --git a/src/crepe/api/game.cpp b/src/crepe/api/game.cpp index 02a0132..01920a9 100644 --- a/src/crepe/api/game.cpp +++ b/src/crepe/api/game.cpp @@ -2,17 +2,29 @@ #include "game.h" -#include "api/spritesheet.h" +#include "core/renderSystem.h" #include "facade/SdlContext.h" -#include "facade/Texture.h" -#include -void game::render(std::vector & draw, std::vector & ss){ - auto& ctx = crepe::SdlContext::get_instance(); - - ctx.loop(*draw[0], *ss[0]); +Engine::Engine(int windowHeight, int window_with){ + crepe::SdlContext& ctx = crepe::SdlContext::get_instance(); } +void Engine::loop() { + + bool running = true; + crepe::SdlContext& ctx = crepe::SdlContext::get_instance(); + RenderSystem rendering; + + while (running) { + ctx.handleEvents(running); + + ctx.clearScreen(); + + rendering.render(); + + ctx.presentScreen(); + } +} -- cgit v1.2.3