1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Use OGLRender::copyTexturedRect in FrameBuffer::_getSubTexture

Remove GLES2-specific code.
This commit is contained in:
Sergey Lipskiy 2016-06-23 16:12:50 +06:00
parent d62c383390
commit 4cb53d9675
2 changed files with 5 additions and 11 deletions

View File

@ -368,21 +368,14 @@ CachedTexture * FrameBuffer::_getSubTexture(u32 _t)
if (y0 + copyHeight > m_pTexture->realHeight)
copyHeight = m_pTexture->realHeight - y0;
#ifdef GLES2
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_FBO);
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, x0, y0, copyWidth, copyHeight, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
#else
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_FBO);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_SubFBO);
glDisable(GL_SCISSOR_TEST);
glBlitFramebuffer(x0, y0, x0 + copyWidth, y0 + copyHeight,
0, 0, copyWidth, copyHeight,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
glEnable(GL_SCISSOR_TEST);
video().getRender().copyTexturedRect(x0, y0, x0 + copyWidth, y0 + copyHeight,
m_pTexture->realWidth,m_pTexture->realHeight, m_pTexture->glName,
0, 0, copyWidth, copyHeight,
m_pSubTexture->realWidth, m_pSubTexture->realHeight, GL_NEAREST);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
frameBufferList().setCurrentDrawBuffer();
#endif
return m_pSubTexture;
}

View File

@ -17,6 +17,7 @@
#include <GLES2/gl2.h>
#define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER
#define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER
#define NO_BLIT_BUFFER_COPY
#define GLESX
#ifdef PANDORA
typedef char GLchar;