清除/释放OpenGL ES缓冲区 [英] Clearing/releasing OpenGL ES buffers
问题描述
我要在OpenGL ES 1.1 iOS应用程序中创建额外的帧缓冲区和渲染缓冲区,以进行屏幕外渲染.当我渲染到其他渲染缓冲区时,我开始在XCode控制台中看到内存警告. 释放",清除"等这些额外缓冲区的正确方法是什么?
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?
我尝试了glClear(GL_COLOR_BUFFER_BIT)
,但是内存警告仍在继续.注释掉渲染代码会使警告消失.
I experimented with glClear(GL_COLOR_BUFFER_BIT)
but the memory warnings continued. Commenting out the rendering code causes the warnings to go away.
推荐答案
我不知道您的意思, glDeleteFramebuffers
和 glDeleteRenderbuffers
,可能带有一些OES后缀.
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.
这篇关于清除/释放OpenGL ES缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!