aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-11-09 12:14:29 +0100
committerDavid Robillard <d@drobilla.net>2019-11-09 12:15:17 +0100
commit2b029213f97910692d1e48e097cc5cc1ad3b44b7 (patch)
treebac32d9655b1ad95b25cc0c7c777c50e2f977801 /test
parent121bd7edc2ef105836304215d21aa733368f13f4 (diff)
Fix various clang-tidy warnings
Diffstat (limited to 'test')
-rw-r--r--test/pugl_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/pugl_test.c b/test/pugl_test.c
index 6558bf6..f895184 100644
--- a/test/pugl_test.c
+++ b/test/pugl_test.c
@@ -70,6 +70,8 @@ onReshape(PuglView* view, int width, int height)
{
(void)view;
+ const float aspect = (float)width / (float)height;
+
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glClearColor(0.2f, 0.2f, 0.2f, 1.0f);
@@ -79,7 +81,7 @@ onReshape(PuglView* view, int width, int height)
glViewport(0, 0, width, height);
float projection[16];
- perspective(projection, 1.8f, width / (float)height, 1.0, 100.0f);
+ perspective(projection, 1.8f, aspect, 1.0f, 100.0f);
glLoadMatrixf(projection);
}