From f7944239b793d1d5c49336856965d3a793f99316 Mon Sep 17 00:00:00 2001 From: Omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Fri, 10 May 2024 13:24:05 +1000 Subject: make core a static and add a default scene to it --- examples/triangle/ex_triangle.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'examples/triangle/ex_triangle.c') diff --git a/examples/triangle/ex_triangle.c b/examples/triangle/ex_triangle.c index 3a9b7db..97d6484 100644 --- a/examples/triangle/ex_triangle.c +++ b/examples/triangle/ex_triangle.c @@ -12,8 +12,10 @@ // Example setting up a renderer +extern core g_core; + int main() { - core* core = core_bringup(); + core_bringup(); arena scratch = arena_create(malloc(1024 * 1024), 1024 * 1024); gpu_renderpass_desc pass_description = {}; @@ -44,11 +46,11 @@ int main() { gpu_pipeline* gfx_pipeline = gpu_graphics_pipeline_create(pipeline_description); // Main loop - while (!should_exit(core)) { + while (!should_exit(&g_core)) { glfwPollEvents(); - input_update(&core->input); + input_update(&g_core.input); - render_frame_begin(&core->renderer); + render_frame_begin(&g_core.renderer); static f64 x = 0.0; x += 0.01; @@ -74,11 +76,11 @@ int main() { // Submit gpu_backend_end_frame(); - render_frame_end(&core->renderer); + render_frame_end(&g_core.renderer); // glfwSwapBuffers(core->renderer.window); } - renderer_shutdown(&core->renderer); + renderer_shutdown(&g_core.renderer); return 0; } -- cgit v1.2.3-70-g09d2