Prepare for rendering and presentation
This commit is contained in:
16
src/global.h
16
src/global.h
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user