summaryrefslogtreecommitdiff
path: root/src/app.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.cpp')
-rw-r--r--src/app.cpp10
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;