From 89d53c615c6802254eba47d48ec65023234f045d Mon Sep 17 00:00:00 2001 From: HuYingzhuo Date: Thu, 25 Apr 2019 14:08:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0IndexBuffer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/Vulkan/VKBuffer.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/example/Vulkan/VKBuffer.h b/example/Vulkan/VKBuffer.h index 23b29f87..6fe4166b 100644 --- a/example/Vulkan/VKBuffer.h +++ b/example/Vulkan/VKBuffer.h @@ -22,6 +22,7 @@ private: friend class Device; friend class VertexBuffer; + friend class IndexBuffer; Buffer(VkDevice d,const VulkanBuffer &vb) { @@ -71,5 +72,28 @@ public: return Buffer::Map(start*stride,size*stride); } };//class VertexBuffer:public Buffer + +class IndexBuffer:public Buffer +{ + VkIndexType index_type; + uint32_t count; + +private: + + friend class Device; + + IndexBuffer(VkDevice d,const VulkanBuffer &vb,VkIndexType it,uint32_t _count):Buffer(d,vb) + { + index_type=it; + count=_count; + } + +public: + + ~IndexBuffer()=default; + + const VkIndexType GetType ()const{return index_type;} + const uint32 GetCount()const{return count;} +};//class IndexBuffer:public Buffer VK_NAMESPACE_END #endif//HGL_GRAPH_VULKAN_BUFFER_INCLUDE