summaryrefslogtreecommitdiff
path: root/src/gpu/gpu.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-31 15:44:30 +0100
committerskal <pascal.massimino@gmail.com>2026-01-31 15:44:30 +0100
commit0bb7fa35cc340a65c944e546231632379bcfa30c (patch)
tree23913b4d5d26686b45acee5648b147a44877e3a0 /src/gpu/gpu.cc
parent72c0cbcb38732b698d33d52459fed67af56ee2ec (diff)
feat: Add --seek command line option for fast-forward debugging
This feature allows developers to jump to a specific time in the demo sequence (e.g., './demo64k --seek 10.5'). It simulates the game logic, audio state (rendering silent buffers), and visual physics (compute shaders) from t=0 up to the target time before starting real-time playback. Audio initialization is refactored to separate device init and start.
Diffstat (limited to 'src/gpu/gpu.cc')
-rw-r--r--src/gpu/gpu.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc
index 0655bb3..e68b84d 100644
--- a/src/gpu/gpu.cc
+++ b/src/gpu/gpu.cc
@@ -425,6 +425,10 @@ void gpu_draw(float audio_peak, float aspect_ratio, float time, float beat) {
g_main_sequence.render_frame(time, beat, audio_peak, aspect_ratio, g_surface);
}
+void gpu_simulate_until(float time) {
+ g_main_sequence.simulate_until(time, 1.0f / 60.0f);
+}
+
void gpu_shutdown() {
g_main_sequence.shutdown();
} \ No newline at end of file