I am drawing a simple quad in OpenGL at "altitude" y=0.3, and after another quad below this one at altitude y=0 an开发者_StackOverflow社区d in another color.
However when being above with the camera or turning around, the quad below appears above the higher one.
Is a 0.3 altitude too low for OpenGL or has this to do in the order they are drawn ? I have read that I could enable glEnable(DEPTH_TEST), but my Cocoa/Xcode environment does not know DEPTH_TEST. Thanks for your help !
You have read right. You dont have the z-buffer enabled. To do this, you need to do glEnable(GL_DEPTH_TEST).
documentation
精彩评论