aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2016-04-25 23:13:19 +0200
committerWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2016-04-25 23:13:19 +0200
commitd687bd910f073bcae853c7f46f6cbe6b88ad66f5 (patch)
treec19d97d9558872e51f41102c5bc73cf8fb3a9ea1 /main.c
parenta6d0ebd66b0ca5f4125df72fa96e3ef6bdb8d2ad (diff)
downloadpointoverdrawbench-d687bd910f073bcae853c7f46f6cbe6b88ad66f5.tar.gz
pointoverdrawbench-d687bd910f073bcae853c7f46f6cbe6b88ad66f5.tar.bz2
keep ratio of window filled constant regardless of aspect
Diffstat (limited to 'main.c')
-rw-r--r--main.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/main.c b/main.c
index 5cd6c66..3c8a66c 100644
--- a/main.c
+++ b/main.c
@@ -163,11 +163,30 @@ void display(void)
mat4x4_identity(proj);
float const fov = 0.5;
- mat4x4_frustum(proj,
- -window.aspect*fov,
- window.aspect*fov,
- -fov,
- fov, 1, 5);
+#if 0
+ if( 1. <= window.aspect ) {
+ mat4x4_frustum(proj,
+ -fov*window.aspect,
+ fov*window.aspect,
+ -fov,
+ fov,
+ 1, 5);
+ } else {
+ mat4x4_frustum(proj,
+ -fov,
+ fov,
+ -fov/window.aspect,
+ fov/window.aspect,
+ 1, 5);
+ }
+#else
+ mat4x4_frustum(proj,
+ -fov,
+ fov,
+ -fov,
+ fov,
+ 1, 5);
+#endif
mat4x4 mv;
mat4x4_identity(mv);