summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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;
}