Invert final blit in the OpenGL bindings

We want all of NXT to have the origin in the top left. OpenGL's origin
is the bottom left instead. We are doing a blit already to decouple
the NXT render targets from the OpenGL default framebuffer. Take
advantage of this and invert the blit to make the OpenGL's backend
origin be top left.
This commit is contained in:
Corentin Wallez 2018-02-12 11:01:58 -05:00 committed by Corentin Wallez
parent 54ab71b5ce
commit 1090a10d4f
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ namespace utils {
nxtSwapChainError Present() { nxtSwapChainError Present() {
glBindFramebuffer(GL_READ_FRAMEBUFFER, mBackFBO); glBindFramebuffer(GL_READ_FRAMEBUFFER, mBackFBO);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBlitFramebuffer(0, 0, mWidth, mHeight, 0, 0, mWidth, mHeight, GL_COLOR_BUFFER_BIT, glBlitFramebuffer(0, 0, mWidth, mHeight, 0, mHeight, mWidth, 0, GL_COLOR_BUFFER_BIT,
GL_NEAREST); GL_NEAREST);
glfwSwapBuffers(mWindow); glfwSwapBuffers(mWindow);