Add RenderEngineSDK

This commit is contained in:
Jiga228
2025-10-29 13:20:04 +07:00
parent 1ab74b8128
commit 734db410d1
7 changed files with 289 additions and 230 deletions
+25 -3
View File
@@ -3,14 +3,34 @@
#include <unordered_map>
#include <string>
#include <atomic>
#include <glm/vec3.hpp>
#include <vulkan/vulkan.h>
class ModelManager
{
public:
struct Vertex
{
glm::vec3 pos, color;
static VkVertexInputBindingDescription get_binding_description();
static std::array<VkVertexInputAttributeDescription, 2> get_vertex_attribute_descriptions();
};
class StaticModel
{
//DATA
};
VkPhysicalDevice physical_device_;
VkDevice device_;
VkBuffer vertex_buffer_;
VkBuffer index_buffer_;
public:
StaticModel(const std::vector<Vertex>& vertices, const std::vector<uint32_t>& indices,
VkPhysicalDevice physical_device, VkDevice device);
~StaticModel();
};
struct owner_counter
{
@@ -22,12 +42,14 @@ public:
};
private:
VkPhysicalDevice physical_device_;
VkDevice device_;
std::unordered_map<unsigned int, owner_counter> models;
static unsigned int FNV1aHash (const char *buf);
public:
ModelManager(VkPhysicalDevice physical_device, VkDevice device);
~ModelManager();
StaticModel* LoadModel(const std::string& name);