From dae907ae98d8c7d7ce85fd1b73a713cf377e8f94 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 9 Sep 2010 22:26:40 +0000 Subject: [PATCH] Proper depth buffer handling with minimal alpha support. --- src/video.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index 39646c9a..6e97ce14 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -33,13 +33,16 @@ void Video::Setup(int width, int height) glShadeModel(GL_SMOOTH); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearDepth(1.0); - glDisable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); + glEnable(GL_ALPHA_TEST); + glAlphaFunc(GL_GEQUAL, 0.01f); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + /* Projection matrix: once and for all */ glMatrixMode(GL_PROJECTION); glLoadIdentity();