diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-10-08 15:43:45 +0200 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-10-08 15:43:45 +0200 |
commit | afdd12277a43d3ad7755f028e85c569dece84f0b (patch) | |
tree | 1b619bbd2c95cb676c53f2410a94dd16b5fb54fe /src/crepe/api/game.cpp | |
parent | 035444c1b7ee2e76c235e16eafd6115e849eec73 (diff) |
rendering system
Diffstat (limited to 'src/crepe/api/game.cpp')
-rw-r--r-- | src/crepe/api/game.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
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 <vector> -void game::render(std::vector<crepe::Texture*> & draw, std::vector<crepe::api::Spritesheet*> & 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(); + } +} |