Fixed OpenGL rendering ratio being discarded on camera move

This commit is contained in:
Michaël Lemaire 2015-08-25 00:52:33 +02:00
parent 1077e4dca3
commit 98f0708d3e

View file

@ -112,20 +112,22 @@ void OpenGLRenderer::setCamera(CameraDefinition *camera)
{
camera->copy(render_camera);
getScenery()->keepCameraAboveGround(render_camera);
render_camera->setRenderSize(vp_width, vp_height);
cameraChangeEvent(render_camera);
}
void OpenGLRenderer::resize(int width, int height)
{
if (ready)
{
vp_width = width;
vp_height = height;
getScenery()->getCamera()->setRenderSize(width, height); // FIXME Should not be needed
render_camera->setRenderSize(width, height);
cameraChangeEvent(render_camera);
prepareOpenGLState();
}
}
void OpenGLRenderer::paint()