make viewport square regardless of aspect ratio
This commit is contained in:
parent
8bf954dd97
commit
65e011b55c
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user