fix GL projection matrix adjustment on window resize

This commit is contained in:
Josh Holtrop 2012-08-14 22:16:55 -04:00
parent aedc9b664c
commit 4bb7a8dab7

View File

@ -75,5 +75,8 @@ void Client::resize_window(int width, int height)
{ {
glViewport(0, 0, width, height); glViewport(0, 0, width, height);
float aspect = (float)width / (float)height; float aspect = (float)width / (float)height;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.2 * aspect, 1.2 * aspect, -1.2, 1.2, 1, -1); glOrtho(-1.2 * aspect, 1.2 * aspect, -1.2, 1.2, 1, -1);
glMatrixMode(GL_MODELVIEW);
} }