Bläddra i källkod

Proper depth buffer handling with minimal alpha support.

legacy
Sam Hocevar sam 14 år sedan
förälder
incheckning
dae907ae98
1 ändrade filer med 6 tillägg och 3 borttagningar
  1. +6
    -3
      src/video.cpp

+ 6
- 3
src/video.cpp Visa fil

@@ -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();


Laddar…
Avbryt
Spara