You did not. The clip plane distances have to be positive. You have to change the coordinates of your vertices, either by setting the Z-coordinates directly or indirectly by translating the model view matrix.
I have been investigating the issue. I learned that glPerspective() has an alternative called glOrtho(), and it is more suitable for 2D projection. I think I also learned how to use it. Please correct me if I'm wrong in any part. We first change current matrix by glMatrixMode(GL_PROJECTION). Now we can load a projection matrix to take a projection of the 3D world on the the 2D screen. There are infinitely many projection matrix alternatives, but (as far as I know) two of them are standard alternatives. One is "perspective" projection, the other is "orthogonal". We take the perspective projection by calling the glPerspective() function. While we take orthogonal projection by calling the glOrtho() function. When we load a new projection matrix, it is multiplied by the current one. So we reset it first by loading identity matrix to it by calling glLoadIdentity().
A proper projection matrix initialization may be like this:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(/*GLdouble left*/ -2.0,
/*GLdouble right*/ +2.0,
/*GLdouble bottom*/ -2.0,
/*GLdouble top*/ +2.0,
/*GLdouble zNear*/ -2.0,
/*GLdouble zFar*/ +2.0);
//gluPerspective(52.0f, (GLfloat) Settings::GRAPHAREA_WIDTH / (GLfloat) Settings::GRAPHAREA_HEIGHT, -2.0f, 5.0f);
With an initialization like this, any object withing the cube [(-2,+2),(-2,+2),(-2,+2)] will be orthogonally projected to the x-y plane at z=-2.
Am I correct? I don't think so. Because I still don't see anything on my screen. I'm waiting for someone to counter-prove me by correcting my mistakes in my explanation.
I changed the z-dimension component of my vertexes as seen below.
void Engine::WmPaint()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glColor3ub(255, 128, 80);
glBegin(GL_POINTS);
for (float i=-1.0; i<+1.0; i+=0.001) glVertex3f(i, +i, -0.5f);
for (float i=-1.0; i<+1.0; i+=0.001) glVertex3f(i, -i, +0.5f);
glEnd();
}