[vlc-commits] opengl: rename variables to match the documention

Steve Lhomme git at videolan.org
Thu Nov 10 11:13:20 CET 2016


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Fri Oct 28 16:08:58 2016 +0200| [4438dabb801008bdbca752b23fe94aa12a43d30c] | committer: Thomas Guillem

opengl: rename variables to match the documention

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4438dabb801008bdbca752b23fe94aa12a43d30c
---

 modules/video_output/opengl.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index f4b8c3e..2674608 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -1070,17 +1070,17 @@ static void getZoomMatrix(float zoom, GLfloat matrix[static 16]) {
 /* perspective matrix see https://www.opengl.org/sdk/docs/man2/xhtml/gluPerspective.xml */
 static void getProjectionMatrix(float sar, GLfloat matrix[static 16]) {
 
-    float f = 3;
-    float n = 0.1;
+    float zFar  = 10;
+    float zNear = 0.1;
 
     float fovy = (float) M_PI / 3;
-    float d = 1 / tan(fovy / 2);
+    float f = 1 / tan(fovy / 2);
 
     const GLfloat m[] = {
-        d / sar, 0.0, 0.0,                   0.0,
-        0.0,     d,   0.0,                   0.0,
-        0.0,     0.0, (n + f) / (n - f),     -1.0,
-        0.0,     0.0, (2 * n * f) / (n - f), 0.0};
+        f / sar, 0.0,                   0.0,                0.0,
+        0.0,     f,                     0.0,                0.0,
+        0.0,     0.0,     (zNear + zFar) / (zNear - zFar), -1.0,
+        0.0,     0.0, (2 * zNear * zFar) / (zNear - zFar),  0.0};
 
      memcpy(matrix, m, sizeof(m));
 }



More information about the vlc-commits mailing list