From 3481993cc4cc94031e1e70d5aeb4caaf5b720a90 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Tue, 6 Jan 2026 20:30:03 -0600 Subject: [PATCH] ignore --- .gitignore | 1 + core.cm | 2 +- sdl.cm | 12 +++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f0378c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.glb diff --git a/core.cm b/core.cm index b4b9b47..e2c8031 100644 --- a/core.cm +++ b/core.cm @@ -377,7 +377,7 @@ function sample_pose(model, name, time_val) { // Find animation by name or index var anim_idx = -1 - if (typeof name == "number") { + if (is_number(name)) { anim_idx = name } else { for (var i = 0; i < internal.animations.length; i++) { diff --git a/sdl.cm b/sdl.cm index b25b424..a74f35f 100644 --- a/sdl.cm +++ b/sdl.cm @@ -320,7 +320,17 @@ function submit_frame(draws, clear_color, clear_depth, style_id) { } } - var swap_pass = cmd.swapchain_pass(_window, pass_desc) + var swap_tex = cmd.acquire_swapchain_texture(_window) + if (!swap_tex) { + if (cmd.cancel) cmd.cancel() // Cancel if possible, or just submit empty? + // If we can't acquire, we probably shouldn't submit half-baked command buffer. + // But cmd is acquired. + // Just return. + return { draw_calls: 0, triangles: 0 } + } + pass_desc.color_targets[0].texture = swap_tex + + var swap_pass = cmd.render_pass(pass_desc) // Sort draws: opaque first, then cutoff, then blend draws.sort(function(a, b) {