Clearing/releasing OpenGL ES buffers

不打扰是莪最后的温柔 提交于 2019-12-11 03:09:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!