I’m writing a window manager that uses OpenGL as the rasteriser. Bizarrly, I have a problem with straight lines.
I set the screen up so that the x,y dimensions coorespond to the pixel width / height of the video mode.
glMatrixMode(GL_PROJECTION); // set up projection transform
gluOrtho2D(0,(double)x,(double)y,0); // Top left = 0,0 screen origin
glMatrixMode(GL_MODELVIEW); // now change to modelview
When I try an draw a line (glBegin(GL_LINES))that is approx. 75% of the screen away from the origin it is draw at 1 pixel less than the specified coordinate. What makes it really strange is that calls to glBegin(GL_QUADS), for filling the windows, and glDrawPixels get the correct coordinate.