58 lines
1.6 KiB
C++
58 lines
1.6 KiB
C++
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#include "Host/GraphicsAppManager.hpp"
|
|
#include "ExampleApps/CubesExampleApp.hpp"
|
|
#include "ExampleApps/MovingCubeApp.hpp"
|
|
#include "ExampleApps/TexturedCubeExampleApp.hpp"
|
|
|
|
#include <ftxui/component/captured_mouse.hpp>
|
|
#include <ftxui/component/component.hpp>
|
|
#include <ftxui/component/component_options.hpp>
|
|
#include <ftxui/component/screen_interactive.hpp>
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
#include "Shader/ShaderCompiler.hpp"
|
|
|
|
using namespace OpenVulkano;
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
// TEST CASE
|
|
if (false)
|
|
ShaderCompiler::CompileGLSLToSpirv(R"(D:\Projects\OpenVulkano\openVulkanoCpp\Shader\grid.vert)", "", "main",
|
|
shaderc_vertex_shader, false);
|
|
|
|
std::vector<std::string> examples = {
|
|
"Cubes Example App",
|
|
"Moving Cube Example App",
|
|
"Textured Cube Example App",
|
|
};
|
|
|
|
int selectedExample = 0;
|
|
ftxui::MenuOption option;
|
|
auto screen = ftxui::ScreenInteractive::TerminalOutput();
|
|
option.on_enter = screen.ExitLoopClosure();
|
|
auto menu = ftxui::Menu(&examples, &selectedExample, option);
|
|
|
|
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;
|
|
default: throw std::runtime_error("Invalid menu selection!"); break;
|
|
}
|
|
|
|
GraphicsAppManager manager(app.get());
|
|
manager.Run();
|
|
return 0;
|
|
}
|