I guess those glLoadIdentity calls were more important than expected
[xonotic/darkplaces.git] / gl_backend.c
index d61fcef75ea7d261bdb4f1f8cf9591e5c27560d4..a206d951a0b1f0cbd4af1f806c140d857df334fe 100644 (file)
@@ -249,6 +249,7 @@ void GL_SetupView_Mode_Perspective (double fovx, double fovy, double zNear, doub
 
        // set up viewpoint
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
+       qglLoadIdentity();CHECKGLERROR
        // pyramid slopes
        xmax = zNear * tan(fovx * M_PI / 360.0);
        ymax = zNear * tan(fovy * M_PI / 360.0);
@@ -267,6 +268,7 @@ void GL_SetupView_Mode_PerspectiveInfiniteFarClip (double fovx, double fovy, dou
 
        // set up viewpoint
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
+       qglLoadIdentity();CHECKGLERROR
        // set view pyramid
        nudge = 1.0 - 1.0 / (1<<23);
        m[ 0] = 1.0 / tan(fovx * M_PI / 360.0);
@@ -313,6 +315,7 @@ void GL_SetupView_Mode_Ortho (double x1, double y1, double x2, double y2, double
 
        // set up viewpoint
        qglMatrixMode(GL_PROJECTION);CHECKGLERROR
+       qglLoadIdentity();CHECKGLERROR
        qglOrtho(x1, x2, y2, y1, zNear, zFar);
        qglMatrixMode(GL_MODELVIEW);CHECKGLERROR
        GL_SetupView_Orientation_Identity();