From 723475e2a57f0cf806e4b2bcd59dab81bfdc7603 Mon Sep 17 00:00:00 2001 From: Johannes Hendrik Gerard van der Weide Date: Wed, 11 Oct 2023 10:22:08 +0200 Subject: [PATCH] Ordering --- src/Game.hpp | 14 ++++++++++++++ src/ProjectName.cpp | 8 ++++++++ src/main.cpp | 22 ---------------------- 3 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 src/Game.hpp create mode 100644 src/ProjectName.cpp delete mode 100644 src/main.cpp diff --git a/src/Game.hpp b/src/Game.hpp new file mode 100644 index 0000000..848d0df --- /dev/null +++ b/src/Game.hpp @@ -0,0 +1,14 @@ +class Game +{ + public:Game(); + void run(); + + private: + void processEvents(); + void update(); + void render(); + + private: + sf::RenderWindow mWindow; + sf::CircleShape mPlayer; +}; diff --git a/src/ProjectName.cpp b/src/ProjectName.cpp new file mode 100644 index 0000000..52f6db7 --- /dev/null +++ b/src/ProjectName.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + Game game; + game.run(); +} \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index 8bf611b..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include - -int main() -{ - sf::RenderWindow window(sf::VideoMode(640, 480), "SFML Application"); - sf::CircleShape shape; - shape.setRadius(40.f); - shape.setPosition(100.f, 100.f); - shape.setFillColor(sf::Color::Cyan); - while (window.isOpen()) - { - sf::Event event; - while (window.pollEvent(event)) - { - if (event.type == sf::Event::Closed) - window.close(); - } - window.clear(); - window.draw(shape); - window.display(); - } -} \ No newline at end of file