summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoronelin <oscar@nelin.dk>2025-12-03 21:50:14 +0000
committeronelin <oscar@nelin.dk>2025-12-18 21:14:18 +0000
commit4c6c70a1d9eecee94001b271f949673aee4f9c92 (patch)
tree0d833a1eb90917c521924c0ea3675d616db9e52c /src
parenteb06c9d49fddd6ffd5725bf8a33c2eab8cfd94c7 (diff)
Set depthbuffer to 32
Diffstat (limited to 'src')
-rw-r--r--src/daw.c19
1 files 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;
}