diff --git a/source/core/rendering/video.cpp b/source/core/rendering/video.cpp index f44c7e7..6e45a84 100644 --- a/source/core/rendering/video.cpp +++ b/source/core/rendering/video.cpp @@ -64,4 +64,17 @@ auto Video::initSDL() -> int { SDL_Delay(1000); return 0; -} \ No newline at end of file +} + +void Video::clean(int color) { + const Uint8 r = static_cast((color >> 16) & 0xFF); + const Uint8 g = static_cast((color >> 8) & 0xFF); + const Uint8 b = static_cast(color & 0xFF); + + SDL_SetRenderDrawColor(renderer_, r, g, b, 255); + SDL_RenderClear(renderer_); +} + +void Video::present() { + SDL_RenderPresent(renderer_); +} diff --git a/source/core/rendering/video.hpp b/source/core/rendering/video.hpp index b01562b..cfbe439 100644 --- a/source/core/rendering/video.hpp +++ b/source/core/rendering/video.hpp @@ -16,6 +16,9 @@ class Video { Video(Config config); ~Video(); + void clean(int color); + void present(); + private: Config config_; diff --git a/source/game/director.cpp b/source/game/director.cpp index 4af4279..54c98d0 100644 --- a/source/game/director.cpp +++ b/source/game/director.cpp @@ -11,13 +11,19 @@ Director::Director() { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Game start!"); - video_ = std::make_shared