Hi all!!
I'm trying to create a simple 3D game, and I want to put behind my scene a fixed background image.
I read that I need to draw a textured quad in glOrtho for the background, and to draw my 3D objects in glPerspective.
I tried to write my display function in this way:

void display () {
glClear(GL_COLOR_BUFFER_BIT || GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION );
glLoadIdentity();
glOrtho(0,1,0,1,-1,1);
glPushMatrix();
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glDepthMask(GL_FALSE);
glMatrixMode(GL_MODELVIEW);
//draw 2D image
glDepthMask(GL_TRUE);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glClear(GL_COLOR_BUFFER_BIT || GL_DEPTH_BUFFER_BIT );
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0, (GLfloat) W_WIDTH / (GLfloat) W_HEIGHT, 0.1, 1000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(
CameraTemp.Pos.X,CameraTemp.Pos.Y, CameraTemp.Pos.Z,
CameraTemp.Target.X,CameraTemp.Target.Y, CameraTemp.Target.Z,
0.0, 1.0, 0.0);
//draw 3D objects
glutSwapBuffers();
}
...but I see only the 2D background image. Anybody can say what am I wrong?