views:

589

answers:

2

Hi!

I was wondering if I can deallocate the depth buffer in iPhone OpenGL ES to conserve memory? Or it stays until the application finishes?

I only need the depth testing in the beginning of the application.

+1  A: 

You could create a new EAGLContext object and get rid of the old one. When you create the new one, you can set it up however you want.

Dennis Munsie
+1  A: 

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.

Frogblast