3DFileViewer: Set correct aspect ratio in view frustum
This commit is contained in:
parent
7a27ecc135
commit
61e4c09514
Notes:
sideshowbarker
2024-07-17 23:23:17 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/61e4c09514c Pull-request: https://github.com/SerenityOS/serenity/pull/11133 Reviewed-by: https://github.com/sunverwerth ✅
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue