Add example app runner for iOS
This commit is contained in:
@@ -5,10 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "Host/GraphicsAppManager.hpp"
|
||||
#include "ExampleApps/CubesExampleApp.hpp"
|
||||
#include "ExampleApps/MovingCubeApp.hpp"
|
||||
#include "ExampleApps/TexturedCubeExampleApp.hpp"
|
||||
#include "ExampleApps/BillboardExampleApp.hpp"
|
||||
#include "ExampleAppList.hpp"
|
||||
|
||||
#include <ftxui/component/captured_mouse.hpp>
|
||||
#include <ftxui/component/component.hpp>
|
||||
@@ -22,12 +19,11 @@ using namespace OpenVulkano;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::vector<std::string> examples = {
|
||||
"Cubes Example App",
|
||||
"Moving Cube Example App",
|
||||
"Textured Cube Example App",
|
||||
"Billboard Example App"
|
||||
};
|
||||
std::vector<std::string> examples;
|
||||
for (const auto& e : EXAMPLE_APPS)
|
||||
{
|
||||
examples.emplace_back(e.first);
|
||||
}
|
||||
|
||||
int selectedExample = 0;
|
||||
ftxui::MenuOption option;
|
||||
@@ -37,15 +33,9 @@ int main(int argc, char** argv)
|
||||
|
||||
screen.Loop(menu);
|
||||
|
||||
std::unique_ptr<IGraphicsApp> app;
|
||||
switch (selectedExample)
|
||||
{
|
||||
case 0: app = CubesExampleApp::CreateUnique(); break;
|
||||
case 1: app = MovingCubeApp::CreateUnique(); break;
|
||||
case 2: app = TexturedCubeExampleApp::CreateUnique(); break;
|
||||
case 3: app = BillboardExampleApp::CreateUnique(); break;
|
||||
default: throw std::runtime_error("Invalid menu selection!"); break;
|
||||
}
|
||||
if (selectedExample >= examples.size()) throw std::runtime_error("Invalid menu selection!");
|
||||
|
||||
std::unique_ptr<IGraphicsApp> app( EXAMPLE_APPS[selectedExample].second() );
|
||||
|
||||
GraphicsAppManager manager(app.get());
|
||||
manager.Run();
|
||||
|
||||
Reference in New Issue
Block a user