diff --git a/src/FrameBuffer.cpp b/src/FrameBuffer.cpp index d14501ae..3cd80b15 100644 --- a/src/FrameBuffer.cpp +++ b/src/FrameBuffer.cpp @@ -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; } diff --git a/src/OpenGL.h b/src/OpenGL.h index eb66555f..87032367 100644 --- a/src/OpenGL.h +++ b/src/OpenGL.h @@ -17,6 +17,7 @@ #include #define GL_DRAW_FRAMEBUFFER GL_FRAMEBUFFER #define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER +#define NO_BLIT_BUFFER_COPY #define GLESX #ifdef PANDORA typedef char GLchar;