Partial implementation of row interlaced mode.

This commit is contained in:
Christopher Bruns 2016-09-27 19:49:24 -04:00
commit 79046580d5
3 changed files with 27 additions and 8 deletions

View file

@ -576,6 +576,26 @@ void FGLRenderBuffers::BlitToEyeTexture(int eye)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
void FGLRenderBuffers::BlitFromEyeTexture(int eye, GL_IRECT* box)
{
glBindFramebuffer(GL_READ_FRAMEBUFFER, mEyeFBs[eye]);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, mOutputFB);
if (box == nullptr)
box = &GLRenderer->mOutputLetterbox;
glBlitFramebuffer(0, 0, mWidth, mHeight,
box->left, box->top, box->width + box->left, box->height + box->top,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
if ((gl.flags & RFL_INVALIDATE_BUFFER) != 0)
{
GLenum attachments[2] = { GL_COLOR_ATTACHMENT0, GL_DEPTH_STENCIL_ATTACHMENT };
glInvalidateFramebuffer(GL_READ_FRAMEBUFFER, 2, attachments);
}
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
void FGLRenderBuffers::BindEyeTexture(int eye, int texunit)
{
CreateEyeBuffers(eye);