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