From 93f66c387da6751cd03fb0fa136d25a8f7417373 Mon Sep 17 00:00:00 2001
From: Lars Hoerttrich <larshoerttrich@uni-koblenz.de>
Date: Sun, 16 May 2021 14:36:39 +0200
Subject: [PATCH] [#22] Added createBuffer()-template-function to core. Uses
 buffer instead of handle for now

---
 include/vkcv/Core.hpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/vkcv/Core.hpp b/include/vkcv/Core.hpp
index 7a7f3be7..b898d488 100644
--- a/include/vkcv/Core.hpp
+++ b/include/vkcv/Core.hpp
@@ -7,11 +7,11 @@
 #include <vulkan/vulkan.hpp>
 #include "vkcv/Context.hpp"
 #include "vkcv/Handles.hpp"
+#include "vkcv/Buffer.hpp"
 
 namespace vkcv
 {
     // TODO:
-    class Buffer;
     class Renderpass;
     class Pipeline;
 
@@ -92,7 +92,16 @@ namespace vkcv
                            std::vector<const char*> deviceExtensions    = {});
 
         // TODO:
-        BufferHandle createBuffer(const Buffer &buf);
+        /**
+            * Creates a #Buffer with data-type T and @p bufferType 
+            * @param bufferType Type of Buffer created
+            * @param size Amount of Data of type T
+            * return Buffer-Object
+            */
+        template<typename T>
+        Buffer<T> createBuffer(vkcv::BufferType bufferType,size_t size) {
+            return Buffer<T>(m_Context.getDevice(),m_Context.getPhysicalDevice, bufferType,size);
+        };
         PassHandle createRenderPass(const Renderpass &pass) ;
         PipelineHandle createPipeline(const Pipeline &pipeline);
 
-- 
GitLab