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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user