Problem enabling OpenGL ES depth test on iPhone. What steps are necessary?
Posted
by Chris Cooper
on Stack Overflow
See other posts from Stack Overflow
or by Chris Cooper
Published on 2010-03-26T09:04:40Z
Indexed on
2010/03/26
10:33 UTC
Read the original article
Hit count: 200
I remember running into this problem when I started using OpenGL in OS X. Eventually I solved it, but I think that was just by using glut and c++ instead of Objective-C...
The lines of code I have in init
for the ES1Renderer
are as follows:
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
Then in the render
method, I have this:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
I assume I'm missing something specific to either the iPhone or ES. What other steps are required to enable the depth test?
Thanks
© Stack Overflow or respective owner