diff options
Diffstat (limited to 'src/daw.c')
| -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; } |
