um
This commit is contained in:
parent
e4e688b720
commit
3bd0b7e88b
|
@ -1,3 +1,4 @@
|
||||||
|
#define FMT_HEADER_ONLY
|
||||||
#include <fmt/color.h>
|
#include <fmt/color.h>
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <fmt/format.h>
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <span>
|
#include <span>
|
||||||
|
|
||||||
#include "device_manager.hpp"
|
#define FMT_HEADER_ONLY
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include "../structs/swap_chain_support_details.hpp"
|
#include "../structs/swap_chain_support_details.hpp"
|
||||||
|
#include "device_manager.hpp"
|
||||||
|
|
||||||
struct PhysicalDeviceInfo {
|
struct PhysicalDeviceInfo {
|
||||||
vk::PhysicalDevice physical_device;
|
vk::PhysicalDevice physical_device;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1
|
|
||||||
#define VULKAN_HPP_NO_CONSTRUCTORS
|
|
||||||
#include <expected>
|
#include <expected>
|
||||||
#include <span>
|
#include <span>
|
||||||
|
|
||||||
|
#define VULKAN_HPP_NO_CONSTRUCTORS
|
||||||
#include <vulkan/vulkan.hpp>
|
#include <vulkan/vulkan.hpp>
|
||||||
|
|
||||||
#include "../structs/queue_family_indices.hpp"
|
#include "../structs/queue_family_indices.hpp"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Include necessary headers
|
// Include necessary headers
|
||||||
#include <chrono> // For time-related functions
|
#include <chrono> // For time-related functions
|
||||||
|
#define FMT_HEADER_ONLY
|
||||||
#include <fmt/format.h> // For string formatting
|
#include <fmt/format.h> // For string formatting
|
||||||
#include <shaderc/shaderc.hpp> // For shader compilation
|
#include <shaderc/shaderc.hpp> // For shader compilation
|
||||||
#include <unordered_set> // For unordered_set container
|
#include <unordered_set> // For unordered_set container
|
||||||
|
@ -42,6 +43,7 @@ VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE
|
||||||
|
|
||||||
// ImGui headers for GUI
|
// ImGui headers for GUI
|
||||||
#include "gui/imgui_manager.hpp"
|
#include "gui/imgui_manager.hpp"
|
||||||
|
#include "vkfw.hpp"
|
||||||
|
|
||||||
using namespace constants;
|
using namespace constants;
|
||||||
|
|
||||||
|
@ -362,7 +364,7 @@ class VulkanApp {
|
||||||
f64 lastFpsUpdate = 0.0;
|
f64 lastFpsUpdate = 0.0;
|
||||||
i32 frameCounter = 0;
|
i32 frameCounter = 0;
|
||||||
|
|
||||||
while (!WindowManager::shouldClose(mWindow.get())) {
|
while (!mWindow->shouldClose()) {
|
||||||
f64 currentFrame = vkfw::getTime();
|
f64 currentFrame = vkfw::getTime();
|
||||||
deltaTime = currentFrame - lastFrame;
|
deltaTime = currentFrame - lastFrame;
|
||||||
lastFrame = currentFrame;
|
lastFrame = currentFrame;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#define VULKAN_HPP_NO_CONSTRUCTORS
|
||||||
#include <vulkan/vulkan.hpp>
|
#include <vulkan/vulkan.hpp>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,7 +11,7 @@
|
||||||
* supported formats, and presentation modes.
|
* supported formats, and presentation modes.
|
||||||
*/
|
*/
|
||||||
struct SwapChainSupportDetails {
|
struct SwapChainSupportDetails {
|
||||||
vk::SurfaceCapabilitiesKHR capabilities; ///< Surface capabilities
|
vk::SurfaceCapabilitiesKHR capabilities; ///< Surface capabilities
|
||||||
std::vector<vk::SurfaceFormatKHR> formats; ///< Supported surface formats
|
std::vector<vk::SurfaceFormatKHR> formats; ///< Supported surface formats
|
||||||
std::vector<vk::PresentModeKHR> present_modes; ///< Supported presentation modes
|
std::vector<vk::PresentModeKHR> present_modes; ///< Supported presentation modes
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,7 +32,7 @@ fn WindowManager::create(const char* title, const WindowCallbacks& callbacks)
|
||||||
i32 ypos = (videoMode->height - HEIGHT) / 2;
|
i32 ypos = (videoMode->height - HEIGHT) / 2;
|
||||||
|
|
||||||
// Set window position
|
// Set window position
|
||||||
window->setPos(xpos, ypos);
|
// window->setPos(xpos, ypos);
|
||||||
|
|
||||||
// Configure cursor for FPS-style camera control
|
// Configure cursor for FPS-style camera control
|
||||||
window->set<vkfw::InputMode::eCursor>(vkfw::CursorMode::eDisabled);
|
window->set<vkfw::InputMode::eCursor>(vkfw::CursorMode::eDisabled);
|
||||||
|
@ -63,8 +63,6 @@ fn WindowManager::getFramebufferSize(const vkfw::Window& window) -> std::pair<i3
|
||||||
return window.getFramebufferSize();
|
return window.getFramebufferSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn WindowManager::shouldClose(const vkfw::Window& window) -> bool { return window.shouldClose(); }
|
|
||||||
|
|
||||||
fn WindowManager::setTitle(const vkfw::Window& window, const std::string& title) -> void {
|
fn WindowManager::setTitle(const vkfw::Window& window, const std::string& title) -> void {
|
||||||
window.setTitle(title);
|
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 {
|
fn WindowManager::setPosition(const vkfw::Window& window, i32 xpos, i32 ypos) -> void {
|
||||||
window.setPos(xpos, ypos);
|
// window.setPos(xpos, ypos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,15 +45,6 @@ class WindowManager {
|
||||||
*/
|
*/
|
||||||
static fn getFramebufferSize(const vkfw::Window& window) -> std::pair<i32, i32>;
|
static fn getFramebufferSize(const vkfw::Window& window) -> std::pair<i32, i32>;
|
||||||
|
|
||||||
/**
|
|
||||||
* @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.
|
* @brief Sets the window title.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue