Properly resizing render target and view
parent
ad4d671344
commit
8d718eb71f
|
@ -160,7 +160,8 @@ void Renderer::Shutdown() {
|
||||||
void Renderer::RenderGl() {
|
void Renderer::RenderGl() {
|
||||||
int width, height;
|
int width, height;
|
||||||
glfwGetWindowSize(gWindow, &width, &height);
|
glfwGetWindowSize(gWindow, &width, &height);
|
||||||
mRenderTarget.Resize(width, height);
|
if (width != mWidth || height != mHeight)
|
||||||
|
Resize(width, height);
|
||||||
|
|
||||||
// enable the render target
|
// enable the render target
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, mRenderTarget.mFrameBufferId);
|
glBindFramebuffer(GL_FRAMEBUFFER, mRenderTarget.mFrameBufferId);
|
||||||
|
@ -220,5 +221,8 @@ void Renderer::RenderGui() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::Resize (int width, int height) {
|
void Renderer::Resize (int width, int height) {
|
||||||
assert(false);
|
mWidth = width;
|
||||||
|
mHeight = height;
|
||||||
|
mRenderTarget.Resize(mWidth, mHeight);
|
||||||
|
glViewport(0, 0, mWidth, mHeight);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue