From 1d159ce047d66a05031fa5e5baa23a97039fcda3 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Mon, 12 Aug 2024 20:45:59 +0200 Subject: Update TODO --- examples/game_of_life.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 examples/game_of_life.c (limited to 'examples/game_of_life.c') diff --git a/examples/game_of_life.c b/examples/game_of_life.c new file mode 100755 index 0000000..3f33d90 --- /dev/null +++ b/examples/game_of_life.c @@ -0,0 +1,50 @@ +#if 0 /* +#/ ================================================================ +#/ +#/ game_of_life.c +#/ +#/ ================================================================ +#/ +#/ Self-compilation shell script +#/ +SRC=${0##*./} +BIN=${SRC%.*} +gcc \ + -Wall -Wextra -Werror -pedantic \ + -Wno-old-style-declaration \ + -Wno-missing-braces \ + -Wno-unused-variable \ + -Wno-unused-but-set-variable \ + -Wno-unused-parameter \ + -Wno-overlength-strings \ + -O3 \ + -fsanitize=undefined,address,leak -mshstk \ + -lX11 -lm \ + -o $BIN $SRC && \ + ./$BIN $@ && rm $BIN +exit $? # */ +#endif + +#include "../reduced_system_layer.c" + +i32 main(i32 argc, c8 **argv) { + (void) argc; + (void) argv; + + platform = (Platform) { + .title = "Conway's Game of Life", + .frame_width = 960, + .frame_height = 720, + }; + + p_init(); + + while (!platform.done) { + p_handle_events(); + p_render_frame(); + p_sleep_for(0); + } + + p_cleanup(); + return 0; +} -- cgit v1.2.3