Tiny refactor

This commit is contained in:
2024-10-18 16:12:24 +02:00
parent 8ee000ab74
commit 1d5b4499a4
38 changed files with 645 additions and 637 deletions

View File

@@ -39,9 +39,9 @@ Mesh :: struct {
}
get_mesh_vb :: (mesh: *Mesh, pipeline_handle: Pipeline_State_Handle = 0) -> Buffer_Handle {
handle := ifx pipeline_handle == 0 then renderer.current_state.last_set_pipeline else pipeline_handle;
handle := ifx pipeline_handle == 0 then engine.renderer.current_state.last_set_pipeline else pipeline_handle;
pipeline_state := *renderer.pipeline_states[handle-1];
pipeline_state := *engine.renderer.pipeline_states[handle-1];
return get_mesh_vb(mesh, pipeline_state.mesh_data_types);
}
@@ -171,7 +171,7 @@ get_mesh_vb :: (mesh: *Mesh, input: [] Mesh_Vertex_Data_Type) -> Buffer_Handle {
}
vb_size := size_of(float)*stride*mesh.positions.count;
vb := create_vertex_buffer(renderer, final_vertices.data, xx vb_size, stride=size_of(float)*stride);
vb := create_vertex_buffer(engine.renderer, final_vertices.data, xx vb_size, stride=size_of(float)*stride);
table_add(*mesh.vbs, hash, vb);
}
@@ -180,12 +180,12 @@ get_mesh_vb :: (mesh: *Mesh, input: [] Mesh_Vertex_Data_Type) -> Buffer_Handle {
}
delete_mesh :: (handle: Mesh_Handle) {
mesh := parray_get(*renderer.meshes, handle);
mesh := parray_get(*engine.renderer.meshes, handle);
for mesh.vbs {
destroy_buffer(renderer, it);
destroy_buffer(engine.renderer, it);
}
deinit(*mesh.vbs);
parray_remove(*renderer.meshes, handle);
parray_remove(*engine.renderer.meshes, handle);
}