]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
added cls.timedemo check in S_PaintAndSubmit to use cl.mtime[0] for sound sync when...
[xonotic/darkplaces.git] / gl_backend.c
index 5a6b86214ba875c3c1a68d946637475ad4791b5a..93d23b774ddbbc94b58ac72b958b875381f2f845 100644 (file)
@@ -357,6 +357,7 @@ static struct gl_state_s
        GLboolean depthmask;
        int colormask; // stored as bottom 4 bits: r g b a (3 2 1 0 order)
        int depthtest;
+       float depthrange[2];
        int alphatest;
        int scissortest;
        unsigned int unit;
@@ -631,6 +632,16 @@ void GL_DepthTest(int state)
        }
 }
 
+void GL_DepthRange(float nearfrac, float farfrac)
+{
+       if (gl_state.depthrange[0] != nearfrac || gl_state.depthrange[1] != farfrac)
+       {
+               gl_state.depthrange[0] = nearfrac;
+               gl_state.depthrange[1] = farfrac;
+               qglDepthRange(nearfrac, farfrac);
+       }
+}
+
 void GL_CullFace(int state)
 {
        CHECKGLERROR