summaryrefslogtreecommitdiff
path: root/examples/game_of_life.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/game_of_life.c')
-rwxr-xr-xexamples/game_of_life.c15
1 files changed, 7 insertions, 8 deletions
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;
}