From aaa61a3eeb5b1ade783b5a7ec31a6a7fd6b3393e Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sat, 2 Nov 2024 04:08:54 +0100 Subject: Update examples --- examples/game_of_life.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'examples/game_of_life.c') diff --git a/examples/game_of_life.c b/examples/game_of_life.c index 3f33d90..7fee606 100755 --- a/examples/game_of_life.c +++ b/examples/game_of_life.c @@ -27,6 +27,12 @@ exit $? # */ #include "../reduced_system_layer.c" +void update_and_render_frame(void) { + p_handle_events(); + p_render_frame(); + p_sleep_for(0); +} + i32 main(i32 argc, c8 **argv) { (void) argc; (void) argv; @@ -37,14 +43,7 @@ i32 main(i32 argc, c8 **argv) { .frame_height = 720, }; - p_init(); - - while (!platform.done) { - p_handle_events(); - p_render_frame(); - p_sleep_for(0); - } + p_event_loop(); - p_cleanup(); return 0; } -- cgit v1.2.3