diff options
author | Leon Kang <2090093273@qq.com> | 2024-10-03 21:04:37 -0700 |
---|---|---|
committer | Leon Kang <2090093273@qq.com> | 2024-10-03 21:04:37 -0700 |
commit | 1f47c662a07ec83d4033b1a5f4b48dd8dfa58b7b (patch) | |
tree | cfb8941b80d1bc672bf25dba3ca716a1e0bc0823 /src/app.cpp | |
parent | c1ceb18d1c6d8af1266fc9cb9233e2328dd4d723 (diff) | |
parent | e59529d3f55b9128f798a7f02a7288f96bdaf9a4 (diff) | |
download | iris-1f47c662a07ec83d4033b1a5f4b48dd8dfa58b7b.tar.gz iris-1f47c662a07ec83d4033b1a5f4b48dd8dfa58b7b.zip |
Merge branch 'main' into windows-build
Diffstat (limited to 'src/app.cpp')
-rw-r--r-- | src/app.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/app.cpp b/src/app.cpp index f48edd9..11a219d 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -4,6 +4,8 @@ #include "imgui_impl_vulkan.h" #include "argparse/argparse.hpp" #include <cstdint> +#include <spdlog/spdlog.h> +#include <spdlog/cfg/env.h> #include <sys/types.h> #include <vk_mem_alloc.h> #include <vulkan/vulkan_core.h> @@ -16,6 +18,7 @@ #include <vector> int main(int argc, char** argv) { + spdlog::cfg::load_env_levels(); argparse::ArgumentParser program("Iris Renderer"); program.add_argument("width") .help("display width of the window") @@ -39,9 +42,9 @@ int main(int argc, char** argv) { const char* description = nullptr; glfwGetError(&description); if (description != nullptr) { - std::cerr << "Error: " << description << std::endl; + spdlog::critical("Failed to initialize GLFW: {}", description); } else { - std::cerr << "Failed to initialize GLFW" << std::endl; + spdlog::critical("Failed to initialize GLFW"); } glfwTerminate(); @@ -54,7 +57,7 @@ int main(int argc, char** argv) { glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); auto window = glfwCreateWindow(window_width, window_height, "Iris Renderer", nullptr, nullptr); if (window == nullptr) { - std::cerr << "Failed to create GLFW window" << std::endl; + spdlog::critical("Failed to create GLFW window"); abort(); } @@ -103,6 +106,7 @@ int main(int argc, char** argv) { glfwDestroyWindow(swapchain.window); glfwTerminate(); + swapchain.release(); device.destroy(); return 0; |