From 22cb48be89edab597a59aab79b3d871a8e37d8e2 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Thu, 11 Jul 2024 00:10:48 +0200 Subject: [PATCH] Update logging --- openVulkanoCpp/Host/GLFW/WindowGLFW.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/openVulkanoCpp/Host/GLFW/WindowGLFW.cpp b/openVulkanoCpp/Host/GLFW/WindowGLFW.cpp index 03f15e1..6525988 100644 --- a/openVulkanoCpp/Host/GLFW/WindowGLFW.cpp +++ b/openVulkanoCpp/Host/GLFW/WindowGLFW.cpp @@ -253,7 +253,11 @@ namespace OpenVulkano::GLFW vk::SurfaceKHR WindowGLFW::CreateSurface(const vk::Instance& instance, const vk::AllocationCallbacks* pAllocator) { VkSurfaceKHR rawSurface; - const auto result = static_cast(glfwCreateWindowSurface(static_cast(instance), window, reinterpret_cast(pAllocator), &rawSurface)); + const vk::Result result = static_cast(glfwCreateWindowSurface(static_cast(instance), window, reinterpret_cast(pAllocator), &rawSurface)); + if (result != vk::Result::eSuccess) [[unlikely]] + { + Logger::WINDOW->error("Failed to create vulkan surface. Result: {}", vk::to_string(result)); + } return rawSurface;//createResultValue(result, rawSurface, "vk::CommandBuffer::begin"); } @@ -282,19 +286,19 @@ namespace OpenVulkano::GLFW void WindowGLFW::OnFocusLost() { - Logger::WINDOW->debug("Window (id: {0}) focus lost", GetWindowId()); + Logger::WINDOW->trace("Window (id: {0}) focus lost", GetWindowId()); handler->OnWindowFocusLost(this); } void WindowGLFW::OnFocusGained() { - Logger::WINDOW->debug("Window (id: {0}) focus gained", GetWindowId()); + Logger::WINDOW->trace("Window (id: {0}) focus gained", GetWindowId()); handler->OnWindowFocusGained(this); } void WindowGLFW::OnMove(const int posX, const int posY) { - Logger::WINDOW->debug("Window (id: {0}) moved (x: {1}, y: {2})", GetWindowId(), posX, posY); + Logger::WINDOW->trace("Window (id: {0}) moved (x: {1}, y: {2})", GetWindowId(), posX, posY); if (windowConfig.windowMode == WINDOWED || windowConfig.windowMode == BORDERLESS) { // Don't save window position for fullscreen windowConfig.position.x = posX;