--- pogl_matrix.xs_broken	2015-06-16 10:27:15 +1000
+++ pogl_matrix.xs	2015-06-15 21:26:52 +1000
@@ -116,27 +116,27 @@
 }
 
 static void set_data_frustrum(GLfloat * data,
-    GLfloat left, GLfloat right, GLfloat top, GLfloat bottom, GLfloat near, GLfloat far)
+    GLfloat left, GLfloat right, GLfloat top, GLfloat bottom, GLfloat nearby, GLfloat faraway)
 {
     GLfloat width = right-left;
     GLfloat height = bottom-top;
-    GLfloat depth = far-near;
+    GLfloat depth = faraway-nearby;
 
-    data[0]     = near*2.0/width;
+    data[0]     = nearby*2.0/width;
     data[1]     = 0.0;
     data[2]     = 0.0;
     data[3]     = 0.0;
     data[4]     = 0.0;
-    data[5]     = near*2.0/height;
+    data[5]     = nearby*2.0/height;
     data[6]     = 0.0;
     data[7]     = 0.0;
     data[8]     = (right+left)/width;
     data[9]     = (bottom+top)/height;
-    data[10]    = -(far+near)/depth;
+    data[10]    = -(faraway+nearby)/depth;
     data[11]    = -1.0;
     data[12]    = 0.0;
     data[13]    = 0.0;
-    data[14]    = -(far*near*2.0)/depth;
+    data[14]    = -(faraway*nearby*2.0)/depth;
     data[15]    = 0.0;
 }
 
@@ -405,19 +405,19 @@
 #//# $status = $mat->set_frustrum($left, $right, $top, $bottom, $near, $far);
 #//- Set 4x4 Frustrum Matrix; returns 0 if successful
 GLint
-set_frustrum(mat, left, right, top, bottom, near, far)
+set_frustrum(mat, left, right, top, bottom, nearby, faraway)
 	OpenGL::Matrix	mat
 	GLfloat         left
 	GLfloat         right
 	GLfloat         top
 	GLfloat         bottom
-	GLfloat         near
-	GLfloat         far
+	GLfloat         nearby
+	GLfloat         faraway
 	CODE:
 	{
 	    needs_4x4(mat, "set_frustrum");
 
-        set_data_frustrum((GLfloat*)mat->data, left, right, top, bottom, near, far);
+        set_data_frustrum((GLfloat*)mat->data, left, right, top, bottom, nearby, faraway);
 
         RETVAL = 0;
 	}
@@ -427,21 +427,21 @@
 #//# $status = $mat->set_perspective($width, $height, $near, $far, $fov);
 #//- Set 4x4 Perspective Matrix; returns 0 if successful
 GLint
-set_perspective(mat, width, height, near, far, fov)
+set_perspective(mat, width, height, nearby, faraway, fov)
 	OpenGL::Matrix	mat
 	GLfloat         width
 	GLfloat         height
-	GLfloat         near
-	GLfloat         far
+	GLfloat         nearby
+	GLfloat         faraway
 	GLfloat         fov
 	CODE:
 	{
 	    needs_4x4(mat, "set_perspective");
 
         double aspect = width/height;
-        double h_2 = near*tan(fov*PI/360);
+        double h_2 = nearby*tan(fov*PI/360);
         double w_2 = h_2*aspect;
-        set_data_frustrum((GLfloat*)mat->data, -w_2, w_2, -h_2, h_2, near, far);
+        set_data_frustrum((GLfloat*)mat->data, -w_2, w_2, -h_2, h_2, nearby, faraway);
 
         RETVAL = 0;
 	}
@@ -451,21 +451,21 @@
 #//# $status = $mat->set_ortho($left, $right, $top, $bottom, $near, $far);
 #//- Set 4x4 Perspective Matrix; returns 0 if successful
 GLint
-set_ortho(mat, left, right, top, bottom, near, far)
+set_ortho(mat, left, right, top, bottom, nearby, faraway)
 	OpenGL::Matrix	mat
 	GLfloat         left
 	GLfloat         right
 	GLfloat         top
 	GLfloat         bottom
-	GLfloat         near
-	GLfloat         far
+	GLfloat         nearby
+	GLfloat         faraway
 	CODE:
 	{
 	    needs_4x4(mat, "set_ortho");
 
         GLfloat width = right-left;
         GLfloat height = bottom-top;
-        GLfloat depth = far-near;
+        GLfloat depth = faraway-nearby;
 
 		GLfloat * data = (GLfloat*)mat->data;
         data[0]     = 2/width;
@@ -482,7 +482,7 @@
         data[11]    = 0.0;
         data[12]    = (right+left)/width;
         data[13]    = (bottom+top)/height;
-        data[14]    = -(far+near)/depth;
+        data[14]    = -(faraway+nearby)/depth;
         data[15]    = 1.0;
 
         RETVAL = 0;
