Merge pull request #7493 from visiblelight/render_texture_disabled

no need to save/restore for render texture when entering background
This commit is contained in:
minggo 2014-07-17 17:07:54 +08:00
commit 91a537dec6
1 changed files with 6 additions and 0 deletions

View File

@ -94,6 +94,9 @@ RenderTexture::~RenderTexture()
void RenderTexture::listenToBackground(EventCustom *event)
{
// We have not found a way to dispatch the enter background message before the texture data are destroyed.
// So we disable this pair of message handler at present.
#if 0
#if CC_ENABLE_CACHE_TEXTURE_DATA
CC_SAFE_DELETE(_UITextureImage);
@ -118,10 +121,12 @@ void RenderTexture::listenToBackground(EventCustom *event)
glDeleteFramebuffers(1, &_FBO);
_FBO = 0;
#endif
#endif
}
void RenderTexture::listenToForeground(EventCustom *event)
{
#if 0
#if CC_ENABLE_CACHE_TEXTURE_DATA
// -- regenerate frame buffer object and attach the texture
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO);
@ -139,6 +144,7 @@ void RenderTexture::listenToForeground(EventCustom *event)
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _texture->getName(), 0);
glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO);
#endif
#endif
}
RenderTexture * RenderTexture::create(int w, int h, Texture2D::PixelFormat eFormat)