+ /* Configure individual levels */
+ if (lnum < GRITS_LEVEL_WORLD) {
+ /* Disable depth for background levels */
+ glDepthMask(FALSE);
+ glDisable(GL_ALPHA_TEST);
+ } else if (lnum < GRITS_LEVEL_OVERLAY) {
+ /* Enable depth and alpha for world levels */
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GREATER, 0.1);
+ glDepthMask(TRUE);
+ } else {
+ /* Disable depth for Overlay/HUD levels */
+ // This causes rendering glitches not sure why..
+ //glDepthMask(FALSE);
+ }
+
+ /* Draw unsorted objects without depth testing,
+ * these are polygons, etc, rather than physical objects */
+ glDisable(GL_DEPTH_TEST);