Prepare for rendering and presentation

This commit is contained in:
2024-10-08 01:57:32 -05:00
parent a8cbb97fd0
commit 10a8c236f0
7 changed files with 337 additions and 117 deletions

View File

@@ -2,6 +2,7 @@
#include "debug/vulkandebuglibs.h"
#include <iostream>
#include <vector>
#include <optional>
#include <vulkan/vulkan_core.h>
#define GLFW_INCLUDE_VULKAN
@@ -12,4 +13,19 @@ namespace Global {
// so that's one obvious global, as well as the glfw includes!
extern const std::vector<const char*> validationLayers;
extern const bool enableValidationLayers;
extern VkDevice device;
struct QueueFamilyIndices {
// We need to check that the Queue families support graphics operations and window presentation, sometimes they can support one or the other,
// therefore, we take into account both for completion.
std::optional<uint32_t> graphicsFamily;
std::optional<uint32_t> presentFamily;
bool isComplete() {
return graphicsFamily.has_value() && presentFamily.has_value();
}
};
extern VkSurfaceKHR surface;
extern VkPhysicalDevice physicalDevice;
Global::QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device);
}