summaryrefslogtreecommitdiff
path: root/src/rendering.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rendering.c')
-rw-r--r--src/rendering.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rendering.c b/src/rendering.c
index ac7b766..02be7d1 100644
--- a/src/rendering.c
+++ b/src/rendering.c
@@ -435,7 +435,7 @@ 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);
+ ((GladGLContext*)w->context)->Clear(GL_COLOR_BUFFER_BIT);
}
void r_clear_buffer(void *restrict context, RenderTargets *restrict t, u32 framebuffer_idx) {
@@ -446,7 +446,8 @@ void r_clear_buffer(void *restrict context, RenderTargets *restrict t, u32 frame
void render_present(Window* w, RenderObject *restrict default_quad) {
const GladGLContext *restrict gl = w->context;
- gl->BindFramebuffer(GL_FRAMEBUFFER, 0);
+ gl->BindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
+ gl->Disable(GL_DEPTH_TEST);
gl->UseProgram(default_quad->shader.program);
gl->BindTextureUnit(0, default_quad->texture);
gl->BindVertexArray(default_quad->vao);
@@ -549,7 +550,7 @@ void r_draw_model(void *restrict context, RenderTargets *restrict t, u32 framebu
Camera c = *t->cam[framebuffer_idx];
gl->BindFramebuffer(GL_FRAMEBUFFER, t->framebuffer[framebuffer_idx]);
gl->Enable(GL_DEPTH_TEST);
- gl->DepthFunc(GL_LESS);
+ gl->DepthFunc(GL_LEQUAL);
//const f32 s = pos[3];
mat4 view; // view