summaryrefslogtreecommitdiffhomepage
path: root/Game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Game.cpp')
-rw-r--r--Game.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/Game.cpp b/Game.cpp
new file mode 100644
index 0000000..13790d5
--- /dev/null
+++ b/Game.cpp
@@ -0,0 +1,32 @@
+#include "Game.h"
+
+#include <memory>
+#include <utility>
+
+#include <raylib.h>
+
+#include "Screen.h"
+
+
+void
+Game::set(std::unique_ptr<Screen> screen)
+{
+ m_screen = std::move(screen);
+}
+
+
+void
+Game::update(const float dt)
+{
+ if (m_screen)
+ m_screen->update(dt);
+}
+
+
+void
+Game::draw()
+{
+ ClearBackground(BLACK);
+ if (m_screen)
+ m_screen->draw();
+}