From a742bb3b76fb133125ddad7deea9e69743350917 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Tue, 8 Nov 2022 01:49:06 +0200 Subject: [PATCH] adjust fov on aspect change --- src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index bbe64fd..bebba84 100644 --- a/src/main.c +++ b/src/main.c @@ -82,7 +82,6 @@ int init(void) return -1; } vox_framebuf(vox, FB_W, FB_H, fb); - vox_proj(vox, 140, 45, 1, 300); vox_fog(vox, 260, COLOR_HORIZON); vox_filter(vox, hfilt, cfilt); @@ -156,6 +155,10 @@ void idle(void) void reshape(int x, int y) { + float aspect = (float)x / y; + + vox_proj(vox, 140, 40 * aspect, 1, 300); + glViewport(0, 0, x, y); win_width = x; -- 1.7.10.4