iPhone:当上下文消失时,我需要进行多少 OpenGL 清理?
我在 iPhone 应用程序中的几个视图恰好使用了独立的 openGL 上下文。它们不一定是长寿的,因此它们会在该过程发生之前消失。它们每个都有一些纹理。
-release
EAGLContext
是否会导致所有 GL 状态为我清理?或者我是否因找不到调用glDeleteTextures的地方而泄漏纹理等?
谢谢。
I several views in an iPhone app which happen to use independent openGL contexts. They are not necessarily long-lived so they go away before the process does. And they have a couple textures in each.
Does -release
ing the EAGLContext
cause all that GL state to get cleaned up for me? Or am I leaking textures etc by not finding a place to call glDeleteTextures
from?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当对该共享组的最后一个引用被释放时(通常通过销毁所有共享上下文),与该共享组关联的所有资源都将被销毁。
请务必小心:当您将上下文设置为线程的当前上下文时,该上下文将被视为引用。上下文在与它可能绑定到的所有线程分离之前不会被删除。
All resources associated with a sharegroup are destroyed, when the last reference to that sharegroup is released (usually by destroying all of the shared contexts).
Do be careful: when you make a context current for a thread, that counts as a reference. A context will not be deleted until it is detached from all threads that it may have been bound to.