From 8d718eb71fc12b1374ecf36ee91bd83ca1266be7 Mon Sep 17 00:00:00 2001 From: Martin Felis Date: Tue, 13 Feb 2018 17:46:31 +0100 Subject: [PATCH] Properly resizing render target and view --- src/modules/RenderModule.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/RenderModule.cc b/src/modules/RenderModule.cc index fad207c..1c122ab 100644 --- a/src/modules/RenderModule.cc +++ b/src/modules/RenderModule.cc @@ -160,7 +160,8 @@ void Renderer::Shutdown() { void Renderer::RenderGl() { int width, height; glfwGetWindowSize(gWindow, &width, &height); - mRenderTarget.Resize(width, height); + if (width != mWidth || height != mHeight) + Resize(width, height); // enable the render target glBindFramebuffer(GL_FRAMEBUFFER, mRenderTarget.mFrameBufferId); @@ -220,5 +221,8 @@ void Renderer::RenderGui() { } void Renderer::Resize (int width, int height) { - assert(false); + mWidth = width; + mHeight = height; + mRenderTarget.Resize(mWidth, mHeight); + glViewport(0, 0, mWidth, mHeight); }