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)
This commit is contained in:
Fayaz Shaikh
2026-03-02 22:11:16 -05:00
committed by GitHub
parent acf4a38555
commit 0b1e51f620

View File

@@ -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)