ECS rendering
This commit is contained in:
24
src/display/renderer.c
Normal file
24
src/display/renderer.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "renderer.h"
|
||||
#include "display/mesh/meshrenderer.h"
|
||||
|
||||
void rendererRender(const ecsid_t camera) {
|
||||
if(camera == -1) return;
|
||||
|
||||
// Get the meshes.
|
||||
uint32_t meshCount;
|
||||
ecsid_t meshes[ECS_ENTITY_COUNT_MAX];
|
||||
meshCount = meshRendererGetAll(meshes);
|
||||
|
||||
cameraPush(camera);
|
||||
for(uint32_t i = 0; i < meshCount; i++) {
|
||||
meshRendererDraw(meshes[i]);
|
||||
}
|
||||
cameraPop();
|
||||
}
|
Reference in New Issue
Block a user