Original Post
I always assumed that 0.0f would be nearest in z-order when using glOrtho(0, width, height, 0, -1, 1); However in order to draw anything on top, a z value of 1.0 has to be passed. Switching those ortho values in my program gives me the opposite effect, where 0.0 is nearest in z-order and 1.0 is farthest. This was the solution to a bitmap problem I had, but my question is. Am I missing something? Here's the code I use to setup projections.
bool RendererOGL::SetProjection(DWORD flag, DWORD width, DWORD height, float fov)
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if(!width || !height){
width = deviceParam.wndWidth;
height = deviceParam.wndHeight;
}
if(flag == PROJ_PERSPECTIVE)
gluPerspective(fov, (GLfloat)width/(GLfloat)height, 0.1f, 1000.0f);
else if(flag == PROJ_ORTHO)
glOrtho(0, width, height, 0, 1, -1); // changed
// gluOrtho2D(0, width, height, 0);
else return false;
glMatrixMode(GL_MODELVIEW);
return true;
}