aboutsummaryrefslogtreecommitdiffstats
path: root/include/vk-context.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-01-26 23:12:49 +0100
committerladevieq <ladevie.quentin@gmail.com>2021-01-26 23:12:49 +0100
commit1314f696a7861f3b1509c7f5c27d6b06bc22d5f1 (patch)
treedc438e1fe4f9c5503f984c00cac190a2cdb6268f /include/vk-context.hpp
parentd3b08c7e8bf808281e32fdef5e5222fb6633a5d0 (diff)
Split vkinstance/vkdevice of renderer into context class
Diffstat (limited to 'include/vk-context.hpp')
-rw-r--r--include/vk-context.hpp40
1 files changed, 40 insertions, 0 deletions
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_