void PluginLoader::Init(Game& game) { std::vector<std::string> dirList; LoadDirectories(dirList); m_rootNode = m_gui.CreateNode(); m_gui.SetNode(m_rootNode); int width, height; game.GetRenderer().GetDisplayMode(&width, &height); glm::vec2 startingPos(width / 2.0f, height / 2.0f + (dirList.size() * 100) / 2.0f); for (const std::string& currentDir : dirList) { using namespace std::placeholders; auto pButton = UI::GUIFactory<UI::Button>::CreateElement(game, startingPos, glm::vec4(0.05f, 0.0f, 0.0f, 1.0f), glm::vec4(1.0f, 0.0f, 0.0f, 1.0f), 50.0f, currentDir, std::bind(&PluginLoader::ButtonCallback, this, _1)); m_gui.AddElement(m_rootNode, pButton); startingPos.y -= 100.0f; } game.EnableEventWaiting(true); }
void MinimumSpanningTree::Init(Game& game) { BuildCamera(game); BuildGraph(game); game.EnableEventWaiting(true); }
void PluginLoader::Destroy(Game& game) { game.EnableEventWaiting(false); }