I've added glClearDepth, but still the same image. I have the following
in my code:
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glClearColor(0.0, 0.0, 0.0, 0.0);
glClearDepth(1.0f); //added in, but still no effect :-(
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //yes, I have a
//same as drawTriangles..
Do I need glFrontFace? or etc? I'm just drawing triangles though.
> Judging by the images it appears that the depth buffer isn't working yet,
> try adding
> somewhere in your initialisation section.
> At the beginning of your painting routine you should have a line along the
> lines of:
> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
> This will clear the screen & reset the depth buffer to the value that you
> specified in glClearDepth().
> hope this helps