aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client
diff options
context:
space:
mode:
authorFayaz Shaikh <61674751+fayaz12g@users.noreply.github.com>2026-03-02 22:11:16 -0500
committerGitHub <noreply@github.com>2026-03-03 10:11:16 +0700
commit0b1e51f620317e29666d6f3382a442544d783af6 (patch)
tree55e2ce1ae4abb22b6e7a01154eec6f8455aed7c0 /Minecraft.Client
parentacf4a38555b4fd5f90319354178ea66af287f741 (diff)
Cleaner implementation of support dynamic resizing aspect ratio (#228)
* Add dynamic resolution * Clean up implementation * Use existing ints instead of new ones * Remove WM_SIZE argument (unecessary now that we directly use g_iScreenWidth and g_iScreenHeight)
Diffstat (limited to 'Minecraft.Client')
-rw-r--r--Minecraft.Client/glWrapper.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Minecraft.Client/glWrapper.cpp b/Minecraft.Client/glWrapper.cpp
index 93b13d40..540271b9 100644
--- a/Minecraft.Client/glWrapper.cpp
+++ b/Minecraft.Client/glWrapper.cpp
@@ -48,12 +48,13 @@ void glLoadIdentity()
RenderManager.MatrixSetIdentity();
}
-extern UINT g_ScreenWidth;
-extern UINT g_ScreenHeight;
+extern int g_iScreenWidth;
+extern int g_iScreenHeight;
void gluPerspective(float fovy, float aspect, float zNear, float zFar)
{
- RenderManager.MatrixPerspective(fovy,aspect,zNear,zFar);
+ float dynamicAspect = (float)g_iScreenWidth / (float)g_iScreenHeight;
+ RenderManager.MatrixPerspective(fovy, dynamicAspect, zNear, zFar);
}
void glOrtho(float left,float right,float bottom,float top,float zNear,float zFar)