ECS rendering

This commit is contained in:
2025-08-22 16:15:42 -05:00
parent 94ad64675d
commit f9385ed233
17 changed files with 161 additions and 215 deletions

View File

@@ -0,0 +1,26 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "meshrenderer.h"
meshrenderer_t MESH_RENDERER_DATA[ECS_ENTITY_COUNT_MAX] = { 0 };
ecscomponent_t MESH_RENDERER_COMPONENT = ecsComponentInit(
MESH_RENDERER_DATA,
((ecscomponentcallbacks_t){
.init = NULL,
.entityAdd = NULL,
.entityRemove = NULL
})
);
void meshRendererDraw(const ecsid_t id) {
if(!meshRendererHas(id)) return;
meshrenderer_t *renderer = &MESH_RENDERER_DATA[id];
if(!renderer->mesh) return;
meshDraw(renderer->mesh, 0, -1);
}