From 1314f696a7861f3b1509c7f5c27d6b06bc22d5f1 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Tue, 26 Jan 2021 23:12:49 +0100 Subject: Split vkinstance/vkdevice of renderer into context class --- include/vk-context.hpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 include/vk-context.hpp (limited to 'include/vk-context.hpp') diff --git a/include/vk-context.hpp b/include/vk-context.hpp new file mode 100644 index 0000000..405cd83 --- /dev/null +++ b/include/vk-context.hpp @@ -0,0 +1,40 @@ +#ifndef __VK_CONTEXT_HPP_ +#define __VK_CONTEXT_HPP_ + +#include "vulkan-loader.hpp" +#include "thirdparty/vk_mem_alloc.h" + +class vkcontext { + public: + vkcontext(); + + ~vkcontext(); + + VkInstance instance; + + VkPhysicalDevice physical_device; + VkDevice device; + + VmaAllocator allocator; + + uint32_t queue_index; + VkQueue queue; + + private: + void create_instance(); + + void create_debugger(); + + void create_device(); + + void create_memory_allocator(); + + void select_physical_device(); + + void select_queue(); + + + VkDebugUtilsMessengerEXT debugMessenger; +}; + +#endif // !__VK_CONTEXT_HPP_ -- cgit v1.3