There's a JUCE bug (?) which can be seen in JuceDemo's OpenGL Demo - see screenshot:
Simply resize the window slightly and increase the size of the teapot - and it occasionally occludes the components above it (depending on its current rotation).
Not seen in the screenshot is that these components flicker (at least on OS X 10.11.3) and aren't constantly hidden. (can be seen if stopping the rotation in the right place)
Here's a suggested fix:
https://github.com/soundradix/JUCE/commit/1b4a56c34d0d0ac95aa6a873c15ed109e87345e9
(to just disable depth_test when drawing the components layer)
Cheers, Yair