diff options
| author | onelin <oscar@nelin.dk> | 2025-12-03 21:50:14 +0000 |
|---|---|---|
| committer | onelin <oscar@nelin.dk> | 2025-12-18 21:14:18 +0000 |
| commit | 4c6c70a1d9eecee94001b271f949673aee4f9c92 (patch) | |
| tree | 0d833a1eb90917c521924c0ea3675d616db9e52c | |
| parent | eb06c9d49fddd6ffd5725bf8a33c2eab8cfd94c7 (diff) | |
Set depthbuffer to 32
| -rw-r--r-- | src/daw.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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; } |
