问题
I'm creating an extra framebuffer and renderbuffer for offscreen rendering in my OpenGL ES 1.1 iOS app. When I render into the additional renderbuffer I start to see memory warnings in the XCode console. What is the proper way to "release", "clear" etc these additional buffers?
I experimented with glClear(GL_COLOR_BUFFER_BIT)
but the memory warnings continued. Commenting out the rendering code causes the warnings to go away.
回答1:
I don't know what you mean, glClear clears the content of the buffer (color, depth, stencil, whatever, depending on the bit flags) to a specific value. If you want to delete the buffers and free their resources, once you're finished with them, use glDeleteFramebuffers and glDeleteRenderbuffers respectively, maybe with some OES suffix.
Othwerwise I don't know what you're talking about else and if these two cases don't apply you should just ignore such stupid warnings.
来源:https://stackoverflow.com/questions/7922546/clearing-releasing-opengl-es-buffers