From b9f90793c8c0468d5f35d7af976a6e3bcd206aad Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Fri, 1 Sep 2023 10:10:51 -0400 Subject: add first graphics binding component --- src/components.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/components.hpp (limited to 'src/components.hpp') diff --git a/src/components.hpp b/src/components.hpp new file mode 100644 index 0000000..4c40927 --- /dev/null +++ b/src/components.hpp @@ -0,0 +1,38 @@ +#ifndef PKE_COMPONENTS_HPP +#define PKE_COMPONENTS_HPP + +#include"macros.hpp" +#include + +const uint64_t ECS_UNSET_VAL = 0xFFFFFFFFFFFFFFFF; + +TypeSafeInt_H(EntityHandle, uint64_t, UINT64_MAX); +TypeSafeInt_H(GrBindsHandle, uint64_t, UINT64_MAX); + +struct Entity { + EntityHandle handle = EntityHandle{EntityHandle_T{ECS_UNSET_VAL}}; + EntityHandle parentHandle = EntityHandle{EntityHandle_T{ECS_UNSET_VAL}}; + bool isMarkedForRemoval = false; + GrBindsHandle grBindsHandle = GrBindsHandle{GrBindsHandle_T{ECS_UNSET_VAL}}; +}; + +struct CompGrBinds { + EntityHandle entityHandle = EntityHandle{EntityHandle_T{ECS_UNSET_VAL}}; + GrBindsHandle grBindsHandle = GrBindsHandle{GrBindsHandle_T{ECS_UNSET_VAL}}; + VkBuffer vertexBuffer = VK_NULL_HANDLE; + uint32_t vertexFirstBinding = 0; + uint32_t vertexCount = 0; + VkDeviceSize vertexOffsets = 0; + VkBuffer indexBuffer = VK_NULL_HANDLE; + uint32_t indexFirstBinding = 0; + uint32_t indexCount = 0; + VkDeviceSize indexOffsets = 0; + VkBuffer instanceBuffer = VK_NULL_HANDLE; + uint32_t instanceFirstBinding = 0; + uint32_t instanceCount = 0; + VkDeviceSize instanceOffsets = 0; + VkPipelineLayout vkPipelineLayout = VK_NULL_HANDLE; + VkDescriptorSet vkDescriptorSet = VK_NULL_HANDLE; +}; + +#endif /* PKE_COMPONENTS_HPP */ -- cgit v1.2.3