Hi, in my game I am currently drawing everything with immediate mode (glBegin(), glEnd()). There is this strange bug of seeing quads behind drawn quads. How should I go about fixing this?
(The yellow platforms do not go past the blue wall in the code, at certain angles I can see more or less of the yellow quads. The image on the right is a wireframe view.)
If it helps, this is my code I use to init 3D drawing.
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GLU.gluPerspective((float) 110, (float) DisplayInformation.getDisplayCurrentWidth() / DisplayInformation.getDisplayCurrentHeight(), MIN_VIEW_DISTANCE,
MAX_VIEW_DISTANCE);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
GL11.glClearDepth(1.0f);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
Fog.fog();
Thank you for your time.