diff --git a/src/init/debug_messenger.cpp b/src/init/debug_messenger.cpp index 7a94313..079c845 100644 --- a/src/init/debug_messenger.cpp +++ b/src/init/debug_messenger.cpp @@ -1,3 +1,4 @@ +#define FMT_HEADER_ONLY #include #include diff --git a/src/init/device_manager.cpp b/src/init/device_manager.cpp index 83349a9..c2efde3 100644 --- a/src/init/device_manager.cpp +++ b/src/init/device_manager.cpp @@ -1,11 +1,12 @@ #include -#include #include #include -#include "device_manager.hpp" +#define FMT_HEADER_ONLY +#include #include "../structs/swap_chain_support_details.hpp" +#include "device_manager.hpp" struct PhysicalDeviceInfo { vk::PhysicalDevice physical_device; diff --git a/src/init/device_manager.hpp b/src/init/device_manager.hpp index 0fb9ea3..34b3683 100644 --- a/src/init/device_manager.hpp +++ b/src/init/device_manager.hpp @@ -1,9 +1,9 @@ #pragma once -#define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1 -#define VULKAN_HPP_NO_CONSTRUCTORS #include #include + +#define VULKAN_HPP_NO_CONSTRUCTORS #include #include "../structs/queue_family_indices.hpp" diff --git a/src/main.cpp b/src/main.cpp index 0faaf70..a7e868c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,6 @@ // Include necessary headers -#include // For time-related functions +#include // For time-related functions +#define FMT_HEADER_ONLY #include // For string formatting #include // For shader compilation #include // For unordered_set container @@ -42,6 +43,7 @@ VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE // ImGui headers for GUI #include "gui/imgui_manager.hpp" +#include "vkfw.hpp" using namespace constants; @@ -362,7 +364,7 @@ class VulkanApp { f64 lastFpsUpdate = 0.0; i32 frameCounter = 0; - while (!WindowManager::shouldClose(mWindow.get())) { + while (!mWindow->shouldClose()) { f64 currentFrame = vkfw::getTime(); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; diff --git a/src/structs/swap_chain_support_details.hpp b/src/structs/swap_chain_support_details.hpp index 7d032c2..903b8d4 100644 --- a/src/structs/swap_chain_support_details.hpp +++ b/src/structs/swap_chain_support_details.hpp @@ -1,6 +1,7 @@ #pragma once #include +#define VULKAN_HPP_NO_CONSTRUCTORS #include /** @@ -10,7 +11,7 @@ * supported formats, and presentation modes. */ struct SwapChainSupportDetails { - vk::SurfaceCapabilitiesKHR capabilities; ///< Surface capabilities - std::vector formats; ///< Supported surface formats - std::vector present_modes; ///< Supported presentation modes + vk::SurfaceCapabilitiesKHR capabilities; ///< Surface capabilities + std::vector formats; ///< Supported surface formats + std::vector present_modes; ///< Supported presentation modes }; diff --git a/src/window/window_manager.cpp b/src/window/window_manager.cpp index 29e2b7e..ec86f35 100644 --- a/src/window/window_manager.cpp +++ b/src/window/window_manager.cpp @@ -32,7 +32,7 @@ fn WindowManager::create(const char* title, const WindowCallbacks& callbacks) i32 ypos = (videoMode->height - HEIGHT) / 2; // Set window position - window->setPos(xpos, ypos); + // window->setPos(xpos, ypos); // Configure cursor for FPS-style camera control window->set(vkfw::CursorMode::eDisabled); @@ -63,8 +63,6 @@ fn WindowManager::getFramebufferSize(const vkfw::Window& window) -> std::pair bool { return window.shouldClose(); } - fn WindowManager::setTitle(const vkfw::Window& window, const std::string& title) -> void { window.setTitle(title); } @@ -74,5 +72,5 @@ fn WindowManager::setCursorMode(const vkfw::Window& window, vkfw::CursorMode mod } fn WindowManager::setPosition(const vkfw::Window& window, i32 xpos, i32 ypos) -> void { - window.setPos(xpos, ypos); + // window.setPos(xpos, ypos); } diff --git a/src/window/window_manager.hpp b/src/window/window_manager.hpp index 9b1fcb7..cc26426 100644 --- a/src/window/window_manager.hpp +++ b/src/window/window_manager.hpp @@ -45,15 +45,6 @@ class WindowManager { */ static fn getFramebufferSize(const vkfw::Window& window) -> std::pair; - /** - * @brief Checks if the window should close. - * - * @param window GLFW window - * @return true Window should close - * @return false Window should stay open - */ - static fn shouldClose(const vkfw::Window& window) -> bool; - /** * @brief Sets the window title. *