I haven't used OpenGL for a long time and have trouble setting up a 2D screen where the upper left window coordinates are (0,0) and the width and height of the window are the max x and max y OpenGL coordinates, such that:
glBegin(GL_LINES);
glVertex2i(0,0);
glVertex2i(800, 0);
glVertex2i(0,0);
glVertex2i(0, 600);
glEnd();
does draw one line at the top of the window and one that goes down from the top. I found many examples for glOrtho(left, right, bottom, top, near, far), but none explains what I need here. I hope the question is not too trivial and you can help me.
glOrthocall looks correct. Perhaps the state is wrong? I suggest to checkglViewport, the matrix mode and whether or not the projection matrix is set to identity beforeglOrthois called. \$\endgroup\$