summaryrefslogtreecommitdiff
path: root/src/new_render/render_frame.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/new_render/render_frame.h')
-rw-r--r--src/new_render/render_frame.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/new_render/render_frame.h b/src/new_render/render_frame.h
new file mode 100644
index 0000000..11b24f2
--- /dev/null
+++ b/src/new_render/render_frame.h
@@ -0,0 +1,27 @@
+#pragma once
+#include "camera.h"
+#include "defines.h"
+#include "ral_types.h"
+#include "render_types.h"
+
+// Frame lifecycle on CPU
+
+// 1. extract
+// 2. culling
+// 3. render
+// 4. dispatch (combined with render for now)
+
+typedef struct Cull_Result {
+ u64 n_visible_objects;
+ u64 n_culled_objects;
+ u32* visible_ent_indices; // allocated on frame arena
+ size_t index_count;
+} Cull_Result;
+
+// everything that can be in the world, knows how to extract rendering data
+typedef void (*ExtractRenderData)(void* world_data);
+
+typedef struct Renderer Renderer;
+
+/** @brief Produces a smaller set of only those meshes visible in the camera frustum on the CPU */
+Cull_Result Frame_Cull(Renderer* ren, RenderEnt* entities, size_t entity_count, Camera *camera); \ No newline at end of file