[ADD] The scene switching works now, the only thing to do is controling the scenes with the keys!

This commit is contained in:
Lars
2021-05-28 16:04:41 +02:00
parent 93b3223737
commit 5d31327a47
7 changed files with 133 additions and 139 deletions

View File

@@ -6,29 +6,26 @@
namespace scene {
class Scene
{
public:
virtual void start() = 0;
virtual void render() = 0;
virtual void update() = 0;
virtual void onKey(int key, int scancode, int action, int mods) {};
};
enum class Scenes
{
STARTUP,
INGAME,
GAMEOVER,
CALIBRATION
CALIBRATION,
STOP
};
extern std::map<Scenes, Scene*> scenes;
extern Scene* current_scene;
extern GLFWwindow* window;
class Scene
{
public:
virtual Scenes start(GLFWwindow* window) = 0;
virtual void render() = 0;
virtual void update(GLFWwindow* window) = 0;
virtual void onKey(GLFWwindow* window, int key, int scancode, int action, int mods) {};
};
}