summaryrefslogtreecommitdiff
path: root/src/app.cpp
diff options
context:
space:
mode:
authorChuyan Zhang <me@zcy.moe>2024-10-05 23:40:53 -0700
committerChuyan Zhang <me@zcy.moe>2024-10-05 23:40:53 -0700
commit9ed211d1ca084b25d1780da3bde19e9da64d4a4a (patch)
treef6cb6350a4999b153c4995a3b3ce3d1d71dea17f /src/app.cpp
parent1866dd531dffc4084dfaf261591bc7ac2a376d67 (diff)
downloadiris-9ed211d1ca084b25d1780da3bde19e9da64d4a4a.tar.gz
iris-9ed211d1ca084b25d1780da3bde19e9da64d4a4a.zip
glTF loader start working
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp13
1 files changed, 13 insertions, 0 deletions
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<int>("width");
int window_height = program.get<int>("height");
+ std::string scene_path = program.get<std::string>("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);