1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

3DFileViewer: Set correct aspect ratio in view frustum

This commit is contained in:
Jelle Raaijmakers 2021-11-29 21:51:47 +01:00 committed by Linus Groh
parent 7a27ecc135
commit 61e4c09514

View file

@ -71,7 +71,9 @@ private:
// Set projection matrix
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-0.5, 0.5, -0.5, 0.5, 1, 1500);
auto const half_aspect_ratio = static_cast<double>(RENDER_WIDTH) / RENDER_HEIGHT / 2;
glFrustum(-half_aspect_ratio, half_aspect_ratio, -0.5, 0.5, 1, 1500);
m_init_list = glGenLists(1);
glNewList(m_init_list, GL_COMPILE);