make viewport square regardless of aspect ratio

This commit is contained in:
Josh Holtrop 2012-03-06 23:09:17 -05:00
parent 8bf954dd97
commit 65e011b55c

View File

@ -34,7 +34,14 @@ int main()
App.Close(); App.Close();
if (Event.Type == sf::Event::Resized) if (Event.Type == sf::Event::Resized)
{
glViewport(0, 0, Event.Size.Width, Event.Size.Height); glViewport(0, 0, Event.Size.Width, Event.Size.Height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.f,
(float)Event.Size.Width / (float)Event.Size.Height,
1.f, 500.f);
}
} }