diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c index 79e9a42..6e5fe71 100644 --- a/src/window.c +++ b/src/window.c @@ -152,7 +152,7 @@ void window_init_renderstack(Window *restrict w, ASSERT(buffer_params != NULL); RenderTargets *t = NULL; - void* allocation = malloc( + usize allocation_sz = sizeof(RenderTargets) + sizeof(*t->framebuffer) * num_fbuf + sizeof(*t->framebuffer_parameters) * num_fbuf + @@ -160,9 +160,10 @@ void window_init_renderstack(Window *restrict w, sizeof(*t->framebuffer_size_callback) * num_fbuf + sizeof(*t->camera_reset_callback) * num_fbuf + sizeof(*t->buffer) * num_buf + - sizeof(*t->buffer_parameters) * num_buf - // TODO: callbacks - ); + sizeof(*t->buffer_parameters) * num_buf; + + void* allocation = malloc(allocation_sz); + memset(allocation, 0, allocation_sz); #define ADVANCE_PTR(target, count)\ t->target = (void*)((u64)allocation + acc); \ |
