From 72c0cbcb38732b698d33d52459fed67af56ee2ec Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 31 Jan 2026 15:36:45 +0100 Subject: feat: Implement Sequence and Effect system for demo choreography Refactors the rendering pipeline into a modular Sequence/Effect system. 'MainSequence' manages the final frame rendering and a list of 'Sequence' layers. 'Sequence' manages a timeline of 'Effect' objects (start/end/priority). Concrete effects (Heptagon, Particles) are moved to 'demo_effects.cc'. Updates main loop to pass beat and aspect ratio. --- src/gpu/gpu.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/gpu/gpu.h') diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h index a78c433..f9c322c 100644 --- a/src/gpu/gpu.h +++ b/src/gpu/gpu.h @@ -32,7 +32,7 @@ struct RenderPass { }; void gpu_init(GLFWwindow *window); -void gpu_draw(float audio_peak, float aspect_ratio, float time); +void gpu_draw(float audio_peak, float aspect_ratio, float time, float beat); void gpu_shutdown(); // Helper functions (exposed for internal/future use) @@ -42,10 +42,12 @@ struct ResourceBinding { // WGPUBufferBindingType_Storage }; -GpuBuffer gpu_create_buffer(size_t size, uint32_t usage, +GpuBuffer gpu_create_buffer(WGPUDevice device, size_t size, uint32_t usage, const void *data = nullptr); -ComputePass gpu_create_compute_pass(const char *shader_code, +ComputePass gpu_create_compute_pass(WGPUDevice device, const char *shader_code, ResourceBinding *bindings, int num_bindings); -RenderPass gpu_create_render_pass(const char *shader_code, +RenderPass gpu_create_render_pass(WGPUDevice device, + WGPUTextureFormat format, // Needed for render pipeline + const char *shader_code, ResourceBinding *bindings, int num_bindings); -- cgit v1.2.3