From 9ed211d1ca084b25d1780da3bde19e9da64d4a4a Mon Sep 17 00:00:00 2001 From: Chuyan Zhang Date: Sat, 5 Oct 2024 23:40:53 -0700 Subject: glTF loader start working --- src/app.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/app.cpp') diff --git a/src/app.cpp b/src/app.cpp index 11a219d..2fd7c31 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -1,4 +1,6 @@ #include "imgui.h" +#include "render_assets.h" +#include "gltf_loader.h" #include "vulkan_swapchain.h" #include "imgui_impl_vulkan.h" @@ -22,10 +24,15 @@ int main(int argc, char** argv) { argparse::ArgumentParser program("Iris Renderer"); program.add_argument("width") .help("display width of the window") + .default_value(1920) .scan<'i', int>(); program.add_argument("height") .help("display height of the window") + .default_value(1080) .scan<'i', int>(); + program.add_argument("scene") + .help("path to the scene file") + .default_value("assets/Box/Box.gltf"); try { program.parse_args(argc, argv); @@ -37,6 +44,7 @@ int main(int argc, char** argv) { int window_width = program.get("width"); int window_height = program.get("height"); + std::string scene_path = program.get("scene"); if (!glfwInit()) { const char* description = nullptr; @@ -72,6 +80,11 @@ int main(int argc, char** argv) { .flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT, .usage = VMA_MEMORY_USAGE_AUTO, }); + iris::Scene scene; + if (!load_gltf(scene_path, scene)) { + spdlog::critical("Failed to load glTF file"); + abort(); + } // end load debug image auto swapchain = iris::Swapchain(window, device, window_width, window_height); -- cgit v1.2.3-70-g09d2