diff options
Diffstat (limited to 'src/daw.c')
| -rw-r--r-- | src/daw.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -245,13 +245,21 @@ i32 engine_run(Instance* p, StateType initial_state, void* state_arg) { // Create only 1 additional framebuffer, in addition to the default // one. This is used to render a texture that is represented as a quad // on the default framebuffer. + ivec2 wsz; + window_get_size(&wsz); FramebufferParameters p[] = { - {.num_attached_buffers = 1, {1600,1600}}, + {.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_TEXTURE_FMT_RGBA8) + 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), }; - window_init_renderstack(w, 1, 1, p, t); + window_init_renderstack(w, 1, 2, p, t); //w->render_targets->cam[0] = &default_renderbuffer_camera; } |
