44 lines
941 B
C++
44 lines
941 B
C++
#pragma once
|
|
|
|
#include <vulkan/vulkan.h>
|
|
#include <vector>
|
|
#include <set>
|
|
|
|
#include "utils.h"
|
|
|
|
namespace Engine {
|
|
|
|
class Surface;
|
|
|
|
class Instance {
|
|
friend class Surface;
|
|
public:
|
|
Instance();
|
|
~Instance();
|
|
|
|
void initialize(const std::vector<const char*>& requiredExtensions);
|
|
void deinitialize();
|
|
void addLayer(const std::string& layerName);
|
|
void addExtension(const std::string& extensionName);
|
|
void enableDebug();
|
|
std::vector<const char*> getLayers() const;
|
|
|
|
std::vector<VkPhysicalDevice> enumeratePhysicalDevices() const;
|
|
|
|
private:
|
|
void setupDebugMessenger();
|
|
bool hasValidationLayers();
|
|
|
|
private:
|
|
bool initialized;
|
|
bool validationLayersEnabledAndSupported;
|
|
std::set<std::string> layerNames;
|
|
std::set<std::string> extensionNames;
|
|
std::vector<const char*> layers;
|
|
std::vector<const char*> extensions;
|
|
VkInstance vk;
|
|
VkDebugUtilsMessengerEXT debugMessenger;
|
|
};
|
|
|
|
}
|