summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main.cc b/src/main.cc
index f7136ef..2ece549 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -129,6 +129,7 @@ float* generate_tone(float* buffer, float freq) {
}
int main(int argc, char** argv) {
+ PlatformState platform_state = {};
bool fullscreen_enabled = false;
float seek_time = 0.0f;
int* width_ptr = nullptr;
@@ -156,8 +157,8 @@ int main(int argc, char** argv) {
fullscreen_enabled = true;
#endif /* STRIP_ALL */
- platform_init_window(fullscreen_enabled, width_ptr, height_ptr);
- gpu_init(platform_get_window(), platform_get_width(), platform_get_height());
+ platform_init(&platform_state, fullscreen_enabled, width_ptr, height_ptr);
+ gpu_init(&platform_state);
audio_init();
// Register drum assets
@@ -234,14 +235,14 @@ int main(int argc, char** argv) {
// Start real audio
audio_start();
- while (!platform_should_close()) {
- platform_poll();
+ while (!platform_should_close(&platform_state)) {
+ platform_poll(&platform_state);
double current_time = platform_get_time() + seek_time; // Offset logic time
update_game_logic(current_time);
- float aspect_ratio = platform_get_aspect_ratio();
+ float aspect_ratio = platform_get_aspect_ratio(&platform_state);
// Adjusted multiplier for visuals (preventing constant 1.0 saturation)
float raw_peak = synth_get_output_peak();
@@ -254,6 +255,6 @@ int main(int argc, char** argv) {
audio_shutdown();
gpu_shutdown();
- platform_shutdown();
+ platform_shutdown(&platform_state);
return 0;
}