From 4c6c70a1d9eecee94001b271f949673aee4f9c92 Mon Sep 17 00:00:00 2001 From: onelin Date: Wed, 3 Dec 2025 22:50:14 +0100 Subject: Set depthbuffer to 32 --- src/daw.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/daw.c b/src/daw.c index 4a99d33..848b5a0 100644 --- a/src/daw.c +++ b/src/daw.c @@ -247,19 +247,20 @@ i32 engine_run(Instance* p, StateType initial_state, void* state_arg) { // on the default framebuffer. ivec2 wsz; window_get_size(&wsz); - FramebufferParameters p[] = { - {.num_attached_buffers = 2, .dimensions = {wsz[0], wsz[1], 0}}, - }; u32 t[] = { BUFFERPARAMETER_SET_PARAMETER(BUFFERPARAMETER_SET_TYPE(0, BufferType_texture), BUFFERPARAMETER_TEXTURE_2D | BUFFERPARAMETER_FMT_RGBA8), + // The depth buffer could also be a texture like so: - // BUFFERPARAMETER_SET_PARAMETER( - // BUFFERPARAMETER_SET_TYPE(0, BufferType_texture), - // BUFFERPARAMETER_TEXTURE_2D | BUFFERPARAMETER_FMT_DEPTH - // ), - BUFFERPARAMETER_SET_PARAMETER(BUFFERPARAMETER_SET_TYPE(0, BufferType_render), BUFFERPARAMETER_RENDERBUFFER_DEPTH | BUFFERPARAMETER_FMT_DEPTH), + BUFFERPARAMETER_SET_PARAMETER( + BUFFERPARAMETER_SET_TYPE(0, BufferType_texture), + BUFFERPARAMETER_TEXTURE_2D | BUFFERPARAMETER_FMT_DEPTH32 + ), + //BUFFERPARAMETER_SET_PARAMETER(BUFFERPARAMETER_SET_TYPE(0, BufferType_render), BUFFERPARAMETER_RENDERBUFFER_DEPTH | BUFFERPARAMETER_FMT_DEPTH32F), + }; + FramebufferParameters p[] = { + {.num_attached_buffers = sizeof(t) / sizeof(t[0]), .dimensions = {wsz[0], wsz[1], 0}}, }; - window_init_renderstack(w, 1, 2, p, t); + window_init_renderstack(w, 1, sizeof(t) / sizeof(t[0]), p, t); //w->render_targets->cam[0] = &default_renderbuffer_camera; } -- cgit v1.3