I’m having some problems with (maybe) the depth buffer…
I’m using plain OGL with VC++ and Win2k on a g400.
The problem :
It seems like OpenGL draws objects in the order the drawing subroutines are called instead of the Z order they should look.
I’ll explain, if I draw a GL_QUAD near the camera and THEN I draw a GL_QUAD far away it draws the second oone in front of the first.
And if I rotate the whole scene 180^ I get the same effect.
The objects seems to be drawn not using the Z values but using the “time” their drawing routines are called.
My gl configs are just
glShadeModel(GL_SMOOTH); // Enable Smooth Shading glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
the result is that a small quad is drawn on a bigger one, because the far quad is drawn AFTER the near one.
Does someone knows how to solve this problem ???