aboutsummaryrefslogtreecommitdiffstats
path: root/examples/cube_view.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-04-02 17:39:54 +0200
committerDavid Robillard <d@drobilla.net>2020-04-02 17:40:56 +0200
commitffa9c8240e4d904da2154466e811302ae313034d (patch)
tree4f4618b267e91b0c575512087fa264cd923e8e3f /examples/cube_view.h
parent6c870cb0d2cae098d7780d7aaaf1815887ef182e (diff)
downloadpugl-ffa9c8240e4d904da2154466e811302ae313034d.tar.gz
pugl-ffa9c8240e4d904da2154466e811302ae313034d.tar.bz2
pugl-ffa9c8240e4d904da2154466e811302ae313034d.zip
Strengthen warnings
Diffstat (limited to 'examples/cube_view.h')
-rw-r--r--examples/cube_view.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/cube_view.h b/examples/cube_view.h
index 82648ac..9fd2349 100644
--- a/examples/cube_view.h
+++ b/examples/cube_view.h
@@ -21,9 +21,9 @@
#include "pugl/gl.h"
static inline void
-reshapeCube(const int width, const int height)
+reshapeCube(const float width, const float height)
{
- const float aspect = (float)width / (float)height;
+ const float aspect = width / height;
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
@@ -31,7 +31,7 @@ reshapeCube(const int width, const int height)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glViewport(0, 0, width, height);
+ glViewport(0, 0, (int)width, (int)height);
float projection[16];
perspective(projection, 1.8f, aspect, 1.0f, 100.0f);
@@ -40,16 +40,16 @@ reshapeCube(const int width, const int height)
static inline void
displayCube(PuglView* const view,
- const double distance,
- const double xAngle,
- const double yAngle,
+ const float distance,
+ const float xAngle,
+ const float yAngle,
const bool entered)
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glTranslatef(0.0f, 0.0f, (float)distance * -1.0f);
- glRotatef((float)xAngle, 0.0f, 1.0f, 0.0f);
- glRotatef((float)yAngle, 1.0f, 0.0f, 0.0f);
+ glTranslatef(0.0f, 0.0f, distance * -1.0f);
+ glRotatef(xAngle, 0.0f, 1.0f, 0.0f);
+ glRotatef(yAngle, 1.0f, 0.0f, 0.0f);
const float bg = entered ? 0.2f : 0.0f;
glClearColor(bg, bg, bg, 1.0f);