make viewport square regardless of aspect ratio
This commit is contained in:
1 parent
8bf954dd97
commit
65e011b55c
1 file changed
+7
@@ -34,7 +34,14 @@ int main()
|
||||
App.Close();
|
||||
|
||||
if (Event.Type == sf::Event::Resized)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user