From 38693905261fc84d60ef9993aa9bd3cd837a5865 Mon Sep 17 00:00:00 2001 From: onelin Date: Wed, 3 Dec 2025 23:13:35 +0100 Subject: Set clearcolor for debugging --- src/daw.c | 2 +- src/rendering.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/daw.c b/src/daw.c index eb85a64..ed41329 100644 --- a/src/daw.c +++ b/src/daw.c @@ -258,7 +258,7 @@ i32 engine_run(Instance* p, StateType initial_state, void* state_arg) { //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}}, + {.num_attached_buffers = sizeof(t) / sizeof(t[0]), .dimensions = {200, 200, 0}}, }; window_init_renderstack(w, 1, sizeof(t) / sizeof(t[0]), p, t); //w->render_targets->cam[0] = &default_renderbuffer_camera; diff --git a/src/rendering.c b/src/rendering.c index d570606..19c77d6 100644 --- a/src/rendering.c +++ b/src/rendering.c @@ -434,11 +434,13 @@ int renderbatch_refresh(RenderBatch* renderbatch) { void render_begin(Window* w) { glfwMakeContextCurrent(w->window); ((GladGLContext*)w->context)->BindFramebuffer(GL_FRAMEBUFFER, 0); + ((GladGLContext*)w->context)->ClearColor(1.f, 0.f, 1.f, 1.f); ((GladGLContext*)w->context)->Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } void r_clear_buffer(void *restrict context, RenderTargets *restrict t, u32 framebuffer_idx) { ((GladGLContext*)context)->BindFramebuffer(GL_FRAMEBUFFER, t->framebuffer[framebuffer_idx]); + ((GladGLContext*)context)->ClearColor(0.f, 0.f, 0.f, 0.f); ((GladGLContext*)context)->Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } -- cgit v1.3