Remove VulkanState dependency
Passing VulkanState everywhere (including windowLoop) made no sense. I know that "globals are evil", but this is the best solution for now.
This commit is contained in:
1 parent
e06288320d
commit
6781c1cff1
16 files changed
+285
-272
No files matched your search
@@ -14,8 +14,7 @@ std::queue<uint16_t> free_ids;
|
||||
|
||||
std::map<uint16_t, std::queue<uint16_t>> instance_free_ids;
|
||||
|
||||
uint16_t create_mesh(rse::graphics::vulkanbase::VulkanState& vulkan_state,
|
||||
std::vector<rse::graphics::vulkanbase::Vertex> vertices,
|
||||
uint16_t create_mesh(std::vector<rse::graphics::vulkanbase::Vertex> vertices,
|
||||
std::vector<uint16_t> indices)
|
||||
{
|
||||
static uint16_t last_id = 0U;
|
||||
@@ -34,13 +33,12 @@ uint16_t create_mesh(rse::graphics::vulkanbase::VulkanState& vulkan_state,
|
||||
indices
|
||||
));
|
||||
|
||||
rse::graphics::vulkanbase::update_mesh_buffers(vulkan_state, vertices, indices);
|
||||
rse::graphics::vulkanbase::update_mesh_buffers(vertices, indices);
|
||||
|
||||
return assignable_id;
|
||||
}
|
||||
|
||||
void create_mesh_instance(rse::graphics::vulkanbase::VulkanState& vulkan_state,
|
||||
uint16_t mesh_id,
|
||||
void create_mesh_instance(uint16_t mesh_id,
|
||||
InstanceData instance_data)
|
||||
{
|
||||
uint16_t instance_id = 0U;
|
||||
@@ -59,7 +57,7 @@ void create_mesh_instance(rse::graphics::vulkanbase::VulkanState& vulkan_state,
|
||||
instance_data
|
||||
);
|
||||
|
||||
rse::graphics::vulkanbase::update_mesh_instances(vulkan_state, instance_data);
|
||||
rse::graphics::vulkanbase::update_mesh_instances(instance_data);
|
||||
}
|
||||
|
||||
//TODO: Replace with something else. It will take to much time to do this each time we draw frame for all the objects
|
||||
|
||||
Reference in new issue
Block a user