The only thing missing in your program is replacing the two hints by this one
hint(DISABLE_DEPTH_TEST);
I tried that, but it didn’t change anything on my machine. The shape that I draw last is always rendered in front, regardless of how they are actually positioned in the space.