summaryrefslogtreecommitdiff
path: root/src/app.h
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2022-11-29 18:19:25 +0100
committerEkaitz Zarraga <ekaitz@elenq.tech>2022-11-29 18:19:25 +0100
commitbf34d835e4ea49bd4ef2e5de2b1fea2fd3c95adc (patch)
treeb1970daefeb7a6a8f406c83126de49c3b928484e /src/app.h
parentcbf859a37aa6b16db7e53cf75405cda720617392 (diff)
Start to use a normal game structure:
- App class that has a StateStack - StateStack - Some State definiton and a minimal TitleState to use as a template - Makefile updated accordingly - Delete old code that was there for testing
Diffstat (limited to 'src/app.h')
-rw-r--r--src/app.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/app.h b/src/app.h
new file mode 100644
index 0000000..7d667f9
--- /dev/null
+++ b/src/app.h
@@ -0,0 +1,27 @@
+#ifndef APP_H
+#define APP_H
+
+#include <SFML/Graphics.hpp>
+#include "states.h"
+#include "resourceManager.h"
+#include "resourceIds.h"
+
+class App {
+ static const sf::Time TIME_PER_FRAME;
+ private:
+ TextureManager textures_;
+ sf::RenderWindow window_;
+ StateStack stateStack_;
+
+ void processInput();
+ void render();
+ void update(sf::Time dt);
+
+ void registerStates();
+
+ public:
+ App();
+ void run();
+};
+
+#endif // APP_H