diff --git a/src/rendering/twn_gl_15_rendering.c b/src/rendering/twn_gl_15_rendering.c index efb82dd..894c1ac 100644 --- a/src/rendering/twn_gl_15_rendering.c +++ b/src/rendering/twn_gl_15_rendering.c @@ -159,7 +159,7 @@ void use_2d_pipeline(void) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(0, (double)ctx.base_render_width, (double)ctx.base_render_height, 0, -1, 1); + glOrtho(0, (double)ctx.base_render_width, (double)ctx.base_render_height, 0, 0, 1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); @@ -211,7 +211,7 @@ void use_texture_mode(TextureMode mode) { glNewList(lists + 0, GL_COMPILE); { glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glDepthFunc(GL_ALWAYS); + glDepthFunc(GL_LESS); glDepthMask(GL_FALSE); glDisable(GL_ALPHA_TEST); } glEndList(); diff --git a/src/rendering/twn_gl_any_rendering.c b/src/rendering/twn_gl_any_rendering.c index 77a7138..c3d0b30 100644 --- a/src/rendering/twn_gl_any_rendering.c +++ b/src/rendering/twn_gl_any_rendering.c @@ -71,6 +71,9 @@ void clear_draw_buffer(void) { (1.0f / 255) * 230, (1.0f / 255) * 230, 1); + glDepthRange(0.0, 1.0); + glDepthMask(GL_TRUE); + /* TODO: don't clear color when skybox is applied? */ /* for that window should match framebuffer */ /* also it is driver dependent, from what i can gather */