Browse Source

Proper depth buffer handling with minimal alpha support.

legacy
Sam Hocevar sam 14 years ago
parent
commit
dae907ae98
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      src/video.cpp

+ 6
- 3
src/video.cpp View File

@@ -33,13 +33,16 @@ void Video::Setup(int width, int height)
glShadeModel(GL_SMOOTH); glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0); 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); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);


glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

/* Projection matrix: once and for all */ /* Projection matrix: once and for all */
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();


Loading…
Cancel
Save