From 9b1f5894e8c5ead3bcb8c8a41d5b660c2ebdeb43 Mon Sep 17 00:00:00 2001 From: Katajisto Date: Tue, 17 Jun 2025 19:24:02 +0300 Subject: [PATCH] mac support --- src/editor/trile_editor.jai | 2 -- src/main.jai | 11 ++++++++--- src/ui/ui.jai | 5 +---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/editor/trile_editor.jai b/src/editor/trile_editor.jai index e88c0b3..88c191b 100644 --- a/src/editor/trile_editor.jai +++ b/src/editor/trile_editor.jai @@ -237,12 +237,10 @@ draw_trile :: () { size = size_of(type_of(trixels)), })); - sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, swapchain = cast,force(sg_swapchain) sglue_swapchain() })); sg_apply_pipeline(gPipelines.trixel.pipeline); sg_apply_bindings(*gPipelines.trixel.bind); sg_apply_uniforms(UB_vs_params, *(sg_range.{ ptr = *vs_params, size = size_of(type_of(vs_params)) })); sg_draw(0, 36, trixel_count); - sg_end_pass(); } trile_editor_shortcuts :: () { diff --git a/src/main.jai b/src/main.jai index 54bf1bc..2b54b65 100644 --- a/src/main.jai +++ b/src/main.jai @@ -35,6 +35,7 @@ Window_Info :: struct { }; get_window_info :: () -> Window_Info { + return Window_Info.{ 1920, 1080, @@ -103,17 +104,21 @@ frame :: () { for event: Input.events_this_frame { GR.getrect_handle_event(event); } + sgl_defaults(); sgl_matrix_mode_projection(); sgl_ortho(0.0, sapp_widthf(), sapp_heightf(), 0.0, -1.0, +1.0); - draw_trile(); - + sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, swapchain = cast,force(sg_swapchain) sglue_swapchain() })); tick_ui(); ui_pass(); - + draw_trile(); + sg_end_pass(); + sg_commit(); + input_per_frame_event_and_flag_update(); + reset_temporary_storage(); } diff --git a/src/ui/ui.jai b/src/ui/ui.jai index 31465ed..21017f8 100644 --- a/src/ui/ui.jai +++ b/src/ui/ui.jai @@ -325,8 +325,5 @@ render_ui :: () { ui_pass :: () { render_ui(); // Generates commands that are handled in arb_tri_flush - sg_begin_pass(*(sg_pass.{ action = state.pass_action, swapchain = cast,force(sg_swapchain) sglue_swapchain() })); - arb_tri_flush(); - sg_end_pass(); - sg_commit(); + arb_tri_flush(); }