Lluvia
Instance.h
Go to the documentation of this file.
1 
8 #ifndef LLUVIA_CORE_VULKAN_INSTANCE_H_
9 #define LLUVIA_CORE_VULKAN_INSTANCE_H_
10 
11 #include <atomic>
12 #include <memory>
13 
15 
16 namespace ll {
17 namespace vulkan {
18 
19  class Instance {
20 
21  public:
26 
36  static VkBool32 VKAPI_CALL debugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData);
37 
38  public:
39  Instance() = delete;
40  Instance(const Instance& instance) = delete;
41  Instance(Instance&& instance) = delete;
42 
43  Instance(bool debugEnabled);
45 
46  Instance& operator=(const Instance& Instance) = delete;
48 
49  vk::Instance& get() noexcept;
50 
51  private:
52  static std::atomic_bool m_hasReceivedVulkanWarningMessages;
53 
54  private:
55  std::vector<const char*> getRequiredLayersNames();
56  std::vector<const char*> getRequiredExtensionNames();
57 
58  vk::DynamicLoader m_loader;
59  vk::Instance m_instance;
60  vk::DebugUtilsMessengerEXT m_debugMessenger;
61  bool m_debugEnabled;
62  };
63 
64 } // namespace vk
65 } // namespace ll
66 
67 #endif // LLUVIA_CORE_VULKAN_INSTANCE_H_
Definition: Instance.h:19
Instance(bool debugEnabled)
Instance(Instance &&instance)=delete
Instance & operator=(const Instance &Instance)=delete
Instance & operator=(Instance &&Instance)=delete
static bool hasReceivedVulkanWarningMessages()
returns whether or not the application has received messages through the debug callback.
static VkBool32 VKAPI_CALL debugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData, void *pUserData)
debug callback function to receive messages from the vulkan debug messenger.
Instance(const Instance &instance)=delete
vk::Instance & get() noexcept
Definition: Buffer.h:28