]> git.tdb.fi Git - libs/gl.git/blobdiff - source/projection.cpp
Windows compatibility:
[libs/gl.git] / source / projection.cpp
index 3a8baf84af3f492925366702b434a46a75e6a478..2c234525ce63e0240bdc891f6d56c29be0484dcd 100644 (file)
@@ -6,15 +6,15 @@ Distributed under the LGPL
 */
 
 #include <cmath>
-#include <GL/gl.h>
+#include "gl.h"
 #include "projection.h"
 
 namespace Msp {
 namespace GL {
 
-void ortho(double left, double right, double bottom, double top, double near, double far)
+void ortho(double left, double right, double bottom, double top, double nearr, double farr)
 {
-       glOrtho(left, right, bottom, top, near, far);
+       glOrtho(left, right, bottom, top, nearr, farr);
 }
 
 void ortho_centered(double width, double height)
@@ -32,20 +32,20 @@ void ortho_topleft(double width, double height)
        ortho(0, width, height, 0, 0, 1);
 }
 
-void frustum(double left, double right, double bottom, double top, double near, double far)
+void frustum(double left, double right, double bottom, double top, double nearr, double farr)
 {
-       glFrustum(left, right, bottom, top, near, far);
+       glFrustum(left, right, bottom, top, nearr, farr);
 }
 
-void frustum_centered(double width, double height, double near, double far)
+void frustum_centered(double width, double height, double nearr, double farr)
 {
-       glFrustum(-width/2, width/2, -height/2, height/2, near, far);
+       glFrustum(-width/2, width/2, -height/2, height/2, nearr, farr);
 }
 
-void perspective(double fov_y, double aspect, double near, double far)
+void perspective(double fov_y, double aspect, double nearr, double farr)
 {
-       double hh=tan(fov_y*M_PI/360)*near;
-       frustum(-hh*aspect, hh*aspect, -hh, hh, near, far);
+       double hh=tan(fov_y*M_PI/360)*nearr;
+       frustum(-hh*aspect, hh*aspect, -hh, hh, nearr, farr);
 }
 
 } // namespace GL