From 2b029213f97910692d1e48e097cc5cc1ad3b44b7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 9 Nov 2019 12:14:29 +0100 Subject: Fix various clang-tidy warnings --- test/pugl_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/pugl_test.c') 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); } -- cgit v1.2.1