Hello
I want implement something like layers. e.g objects should painted in planes (different z values) … but it does not work - the order of objects is always like the painting order independ of the z-value (between 1 and -1 - I use Ortho2D mode).
Yes the zbuffer will work with ortho2D and enabling it is about all you need to do.
He should also make sure that he has a depth buffer requested in the visual or PFD but he probably does even without trying, it should not be relied upon though, it should be explicitly requested.
Other settings like depth test have sensible settings without messing with them, although IMHO you should at least touch these calls so you know what you’re doing.