[ADD] The scene switching works now, the only thing to do is controling the scenes with the keys!
This commit is contained in:
@@ -5,13 +5,19 @@
|
||||
|
||||
namespace scene
|
||||
{
|
||||
std::map<Scenes, Scene*> scenes;
|
||||
Scene* current_scene;
|
||||
GLFWwindow* window;
|
||||
|
||||
void scene::Startup_Scene::start()
|
||||
scene::Scenes scene::Startup_Scene::start(GLFWwindow *window)
|
||||
{
|
||||
while (return_value == scene::Scenes::STARTUP)
|
||||
{
|
||||
render();
|
||||
update(window);
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
void scene::Startup_Scene::render()
|
||||
@@ -19,17 +25,16 @@ namespace scene
|
||||
|
||||
}
|
||||
|
||||
void scene::Startup_Scene::update()
|
||||
void scene::Startup_Scene::update(GLFWwindow* window)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void scene::Startup_Scene::onKey(int key, int scancode, int action, int mods)
|
||||
void scene::Startup_Scene::onKey(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (glfwGetKey(window, GLFW_KEY_SPACE) == GLFW_PRESS)
|
||||
{
|
||||
current_scene = scenes[Scenes::INGAME];
|
||||
current_scene->start();
|
||||
return_value = scene::Scenes::INGAME;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user