tags:

views:

595

answers:

2
+2  A: 

Did you enable the depth buffer in whatever windowing system you are using? For example, using glut you might need to: glutInitDisplayMode(GLUT_DEPTH | ....);

Christopher
I am using qt for my windowing toolkit. I am not aware of any function like that. Do you know if there is one I should be calling simmilar to glut's function.
DHamrick
In the `QGLFormat` object, you should be able to check if the depth buffer is enabled with the `depth` and `setDepth` methods.
ravuya
Thanks. That answer saved my day.
hanno
A: 

When you clear your colour buffer are you also clearing the depth buffer?

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

Are you sure the image isn't correct? Some of those green squares actually
do look higher than the blue ones.

Rhythmic Fistman