diff options
author | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-02-25 13:46:34 +1100 |
---|---|---|
committer | Omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-02-25 13:46:34 +1100 |
commit | da13dc8b030b9c0ed4805dca9dab3c280583a91f (patch) | |
tree | 6210efb3ce808d3122b16ea699b04d3bd24a3a3c /examples/main_loop | |
parent | 348161b7ac920ea450becd35685b81e87342d1e5 (diff) |
split into two examples
Diffstat (limited to 'examples/main_loop')
-rw-r--r-- | examples/main_loop/ex_main_loop.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/examples/main_loop/ex_main_loop.c b/examples/main_loop/ex_main_loop.c index 5870f59..3b2354a 100644 --- a/examples/main_loop/ex_main_loop.c +++ b/examples/main_loop/ex_main_loop.c @@ -1,35 +1,11 @@ #include <glfw3.h> #include "core.h" -#include "file.h" #include "render.h" -#include "str.h" int main() { core* core = core_bringup(); - // Examples of how to work with arenas and strings - size_t arena_size = 1024; - arena scratch = arena_create(malloc(arena_size), arena_size); - arena* a = &scratch; - - str8 hello = str8lit("Hello World"); - - // this works but we should be careful because str8 is not *guaranteed* to point to - // a null-terminated string - printf("String before: '%s' (null-terminated: %s) \n ", hello.buf, - str8_is_null_term(hello) ? "true" : "false"); - - char* c = str8_to_cstr(&scratch, hello); - - printf("String after: %s\n", c); - - str8_opt test_file = str8_from_file(&scratch, str8lit("assets/shaders/ui_rect.vert")); - if (test_file.has_value) { - printf("Contents: %.*s \n", (int)test_file.contents.len, test_file.contents.buf); - printf("Null-terminated: %s\n", str8_is_null_term(test_file.contents) ? "true" : "false"); - } - // Main loop while (!glfwWindowShouldClose(core->renderer.window)) { input_update(&core->input); |