diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-08-12 20:45:59 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-08-12 20:45:59 +0200 |
commit | 1d159ce047d66a05031fa5e5baa23a97039fcda3 (patch) | |
tree | 6aaafd8f3e463c68094da31b9bc44b16b5d005f1 | |
parent | ec7ce54de5583ab11de5b19e6efc146cb52c3418 (diff) | |
download | reduced_system_layer-1d159ce047d66a05031fa5e5baa23a97039fcda3.zip |
Update TODO
-rwxr-xr-x | examples/game_of_life.c | 50 | ||||
-rwxr-xr-x | examples/julia_set.c | 50 | ||||
-rwxr-xr-x | examples/labyrinth.c | 50 | ||||
-rwxr-xr-x | reduced_system_layer.c | 26 |
4 files changed, 169 insertions, 7 deletions
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; +} diff --git a/examples/julia_set.c b/examples/julia_set.c new file mode 100755 index 0000000..85a4674 --- /dev/null +++ b/examples/julia_set.c @@ -0,0 +1,50 @@ +#if 0 /* +#/ ================================================================ +#/ +#/ julia_set.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 = "Julia Set", + .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; +} diff --git a/examples/labyrinth.c b/examples/labyrinth.c new file mode 100755 index 0000000..2c34054 --- /dev/null +++ b/examples/labyrinth.c @@ -0,0 +1,50 @@ +#if 0 /* +#/ ================================================================ +#/ +#/ labyrinth.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 = "Labyrinth", + .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; +} diff --git a/reduced_system_layer.c b/reduced_system_layer.c index a200695..1e360a1 100755 --- a/reduced_system_layer.c +++ b/reduced_system_layer.c @@ -26,6 +26,22 @@ #/ #/ ---------------------------------------------------------------- #/ +#/ To-Do list +#/ +#/ - Examples +#/ - Landscape +#/ - Conway's Game if Life +#/ - Julia Set +#/ - Labyrinth +#/ - Features +#/ - Sound +#/ - Clipboard daemon +#/ +#/ ALSA +#/ https://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_min_8c-example.html +#/ +#/ ---------------------------------------------------------------- +#/ #/ (C) 2024 Mitya Selivanov <guattari.tech>, MIT License #/ #/ ================================================================ @@ -228,6 +244,7 @@ i32 main(i32 argc, c8 **argv) { while (!platform.done) { p_handle_events(); p_render_frame(); + p_sleep_for(0); } p_cleanup(); @@ -240,14 +257,9 @@ i32 main(i32 argc, c8 **argv) { // // PLATFORM IMPLEMENTATION // -// ---------------------------------------------------------------- -// -// TODO -// - Sound -// - Clipboard daemon +// ================================================================ // -// ALSA -// https://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_min_8c-example.html +// Utilities // // ================================================================ |