summaryrefslogtreecommitdiff
path: root/src/components.hpp
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2023-09-01 10:10:51 -0400
committerJonathan Bradley <jcb@pikum.xyz>2023-09-06 17:24:27 -0400
commitb9f90793c8c0468d5f35d7af976a6e3bcd206aad (patch)
treebff30852d5bb594c7ad84c5f7f3d5a385e18fc4a /src/components.hpp
parent092e287ba5669f6ed40b721c0bdf2450dae95af8 (diff)
add first graphics binding component
Diffstat (limited to 'src/components.hpp')
-rw-r--r--src/components.hpp38
1 files changed, 38 insertions, 0 deletions
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 <vulkan/vulkan_core.h>
+
+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 */