清除/释放 OpenGL ES 缓冲区
我正在我的 OpenGL ES 1.1 iOS 应用程序中为离屏渲染创建一个额外的帧缓冲区和渲染缓冲区。当我渲染到附加渲染缓冲区时,我开始在 XCode 控制台中看到内存警告。 “释放”、“清除”等这些附加缓冲区的正确方法是什么?
我尝试了 glClear(GL_COLOR_BUFFER_BIT)
但内存警告仍然存在。注释掉渲染代码会导致警告消失。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道你的意思,
glClear
将缓冲区的内容(颜色、深度、模板等,取决于位标志)清除为特定值。如果您想删除缓冲区并释放其资源,一旦完成它们,请使用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, useglDeleteFramebuffers
andglDeleteRenderbuffers
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.