diff options
| author | Fayaz Shaikh <61674751+fayaz12g@users.noreply.github.com> | 2026-03-04 14:13:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-05 02:13:58 +0700 |
| commit | 9372887aef95bf08b83d1e0d4145fa4a6fd6bc3a (patch) | |
| tree | 54913a067ceac833732eed76aff13792f669229f /Minecraft.Client/glWrapper.cpp | |
| parent | 592282495033e794106d6e5fc893a947211b9c83 (diff) | |
Fix for any aspect ratio in 3D Environments (#320)
* Add initial AnyAspectRatio support
* Remove some logic that didn't work
* Remove rogue back slash
* Remove more remnants
* Update UILayer.h
* Update some comments
* Remove WIP UI changes
* Fix diffs
* Remove UI resize call from `UpdateAspectRatio`
* handle merge conflict
* Update to C++ style static cast
* Fix syntax
Diffstat (limited to 'Minecraft.Client/glWrapper.cpp')
| -rw-r--r-- | Minecraft.Client/glWrapper.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Minecraft.Client/glWrapper.cpp b/Minecraft.Client/glWrapper.cpp index 540271b9..a356e674 100644 --- a/Minecraft.Client/glWrapper.cpp +++ b/Minecraft.Client/glWrapper.cpp @@ -48,13 +48,11 @@ void glLoadIdentity() RenderManager.MatrixSetIdentity(); } -extern int g_iScreenWidth; -extern int g_iScreenHeight; - +// AAR - Use calculated aspect ratio to support dynamic resizing +extern float g_iAspectRatio; void gluPerspective(float fovy, float aspect, float zNear, float zFar) { - float dynamicAspect = (float)g_iScreenWidth / (float)g_iScreenHeight; - RenderManager.MatrixPerspective(fovy, dynamicAspect, zNear, zFar); + RenderManager.MatrixPerspective(fovy, g_iAspectRatio, zNear, zFar); } void glOrtho(float left,float right,float bottom,float top,float zNear,float zFar) |
