diff --git a/cocos/renderer/backend/opengl/CommandBufferGL.cpp b/cocos/renderer/backend/opengl/CommandBufferGL.cpp index 8eed2d2f7c..d9e8899a5d 100644 --- a/cocos/renderer/backend/opengl/CommandBufferGL.cpp +++ b/cocos/renderer/backend/opengl/CommandBufferGL.cpp @@ -60,26 +60,11 @@ namespace CommandBufferGL::CommandBufferGL() { glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFBO); - -#if CC_ENABLE_CACHE_TEXTURE_DATA - _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*){ - if(_generatedFBO) - glGenFramebuffers(1, &_generatedFBO); //recreate framebuffer - }); - Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); -#endif } CommandBufferGL::~CommandBufferGL() { - if(_generatedFBO) - glDeleteFramebuffers(1, &_generatedFBO); - cleanResources(); - -#if CC_ENABLE_CACHE_TEXTURE_DATA - Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundListener); -#endif } void CommandBufferGL::beginFrame() diff --git a/cocos/renderer/backend/opengl/CommandBufferGL.h b/cocos/renderer/backend/opengl/CommandBufferGL.h index c516302cab..61362d92e4 100644 --- a/cocos/renderer/backend/opengl/CommandBufferGL.h +++ b/cocos/renderer/backend/opengl/CommandBufferGL.h @@ -198,15 +198,6 @@ private: void setUniform(bool isArray, GLuint location, unsigned int size, GLenum uniformType, void* data) const; void cleanResources(); - // The frame buffer generated by engine. All frame buffer other than default frame buffer share it. - GLuint _generatedFBO = 0; - bool _generatedFBOBindColor = false; - bool _generatedFBOBindDepth = false; - bool _generatedFBOBindStencil = false; -#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX - bool _framebufferReadWriteDisabled = false; -#endif - GLint _defaultFBO = 0; // The value gets from glGetIntegerv, so need to use GLint GLuint _currentFBO = 0; BufferGL* _vertexBuffer = nullptr;