Depth Buffer

Just posting to see if anyone has had luck adding a depth buffer.

I saw balasan’s post here:

which seems to follow about what apple’s instructions say:…-texts.html

I tried implementing this but I’ve had no luck :frowning: just ending up with a black screen.

has anyone succeeded in adding a depth buffer?

solved. for future people:

look at balasan’s post. the only difference is the code in resizeFromLayer should look like this:

glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer);  
    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);  
    glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);  
	if( ! depthRenderbuffer )  
		glGenRenderbuffersOES(1, &depthRenderbuffer);  
	glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);  
	glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT16_OES, backingWidth, backingHeight);  
	// bind color buffer  
	glBindRenderbufferOES(GL_RENDERBUFFER_OES, colorRenderbuffer);