summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/seq_compiler.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/tools/seq_compiler.py b/tools/seq_compiler.py
index dec3ab1..18d5a1f 100755
--- a/tools/seq_compiler.py
+++ b/tools/seq_compiler.py
@@ -710,11 +710,31 @@ void RenderTimeline(WGPUSurface surface, float time, int width, int height,
}
'''
- # Write output
+ # Write C++ output
with open(args.output, 'w') as f:
f.write(all_cpp)
- print(f"Generated {len(sequences)} sequence(s) -> {args.output}")
+ # Write C++ header
+ header_path = os.path.splitext(args.output)[0] + ".h"
+ header_content = f'''// Generated by seq_compiler.py
+// DO NOT EDIT
+#pragma once
+
+#include "gpu/gpu.h"
+#include "gpu/sequence.h"
+
+void InitializeSequences(const GpuContext& ctx, int width, int height);
+Sequence* GetActiveSequence(float time);
+void RenderTimeline(WGPUCommandEncoder encoder, float time, int width, int height,
+ float beat_time, float audio_intensity);
+void RenderTimeline(WGPUSurface surface, float time, int width, int height,
+ float beat_time, float audio_intensity);
+float GetDemoDuration();
+'''
+ with open(header_path, 'w') as f:
+ f.write(header_content)
+
+ print(f"Generated {len(sequences)} sequence(s) -> {args.output} and {header_path}")
if __name__ == '__main__':
main()