summaryrefslogtreecommitdiff
path: root/src/entities.hpp
blob: c09e8f5d959b027d98684ebe9a0bde7506ce562c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef PKE_ENTITIES_HPP
#define PKE_ENTITIES_HPP

#include "vendor/cgltf-include.hpp"
#include "vendor/stb_image_include.hpp"
#include "ecs.hpp"
#include "components.hpp"
#include "asset-manager.hpp"
#include "memory.hpp"
#include "window.hpp"

#include <vulkan/vulkan_core.h>

struct EntityType {
	const char *modelsDir = nullptr;
	const char *modelFile = nullptr;
	const char *entityTypeCode = nullptr;
	EntityHandle entityHandle = EntityHandle_MAX;
	VkDeviceMemory deviceMemoryVert = VK_NULL_HANDLE;
	VkDeviceMemory deviceMemoryInst = VK_NULL_HANDLE;
	VkDeviceMemory deviceMemoryTexture = VK_NULL_HANDLE;
	VkImage textureImage = VK_NULL_HANDLE;
	VkImageView textureImageView = VK_NULL_HANDLE;
	uint32_t startingInstanceCount = 1024;
	struct Importer_GLTF {
		int16_t AccessorIndexVertex = -1;
		int16_t AccessorIndexNormal = -1;
		int16_t AccessorIndexUV = -1;
		int16_t AccessorIndexIndex = -1;
	} Importer_GLTF;
};
extern DynArray<EntityType> GlobalEntityTypes;

void EntityType_Init();
int64_t EntityType_FindByTypeCode(const char *typeCode);
void EntityType_Load(EntityType &et);
void EntityType_Teardown();

#endif /* PKE_ENTITIES_HPP */