From a485ea2dfad91b7ef171094b82cdb62020839b0a Mon Sep 17 00:00:00 2001 From: onelin Date: Sun, 8 Feb 2026 01:01:26 +0100 Subject: Fix perspective favouring --- src/rendering.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rendering.c b/src/rendering.c index 12b0370..9dfc89c 100644 --- a/src/rendering.c +++ b/src/rendering.c @@ -2,6 +2,7 @@ #include #include +#define CGLM_FORCE_DEPTH_ZERO_TO_ONE #include #include #include @@ -583,7 +584,7 @@ void r_perspective_ortho(Camera *c, f32 sz, ivec2 windowsize) { void r_set_camera(RenderTargets *restrict t, i32 framebuffer_idx, Camera *restrict c) { ASSERT(t != NULL); - ASSERT(framebuffer_idx == -1 || framebuffer_idx < (i32)t->framebuffer_len); + ASSERT(framebuffer_idx >= 0 || framebuffer_idx < (i32)t->framebuffer_len); t->cam[framebuffer_idx] = c; } @@ -981,7 +982,7 @@ void r_attach_buffers(void *restrict ctx, u32 fbo, u32* buffers, u32* buffer_par } } -void framebuffer_size_callback_default(ivec3* dst,ivec2 src) { +void framebuffer_size_callback_default(ivec3* dst, ivec2 src) { glm_ivec2_copy(src, *dst); } -- cgit v1.3