简体   繁体   English

OpenGL ES深度缓冲区

[英]OpenGL ES depth buffer

I was wondering if I can deallocate the depth buffer in iPhone OpenGL ES to conserve memory? 我想知道是否可以在iPhone OpenGL ES中释放深度缓冲区以节省内存? Or it stays until the application finishes? 还是一直持续到应用程序完成?

I only need the depth testing in the beginning of the application. 我只需要在应用程序开始时进行深度测试。

Yes, you can delete the depth buffer at any time. 是的,您可以随时删除深度缓冲区。 Your code is responsible for creating the depth renderbuffer and attaching it to the framebuffer (although this is probably done by some template code that you copied), so you can similarly detach and delete it. 您的代码负责创建深度渲染缓冲区并将其附加到帧缓冲区(尽管这可能是由您复制的某些模板代码完成的),因此您可以类似地分离和删除它。

You could create a new EAGLContext object and get rid of the old one. 您可以创建一个新的EAGLContext对象,并摆脱旧的对象。 When you create the new one, you can set it up however you want. 创建新的时,可以根据需要进行设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM