i am rather new to OpenGL and got already stuck in a (minor?) problem. I wanted to investigate something line related and found that my lines are all one pixel too short, even simple ones like the following.
The viewport is set up with gluOrtho2D.
glColor3ub(255, 255, 255); glBegin(GL_POINTS); glVertex2i(200,30); glVertex2i(300,30); glVertex2i(300,20); glVertex2i(200,20); glEnd(); glColor3ub(255, 0, 0); glBegin(GL_LINES); glVertex2i(200,30); glVertex2i(300,30); glVertex2i(300,20); glVertex2i(200,20); glEnd();
renders to http://evilazrael.net/bilder2/support/opengl_lines.png
There should be no white points visible, but they are. Any idea why this happens? I thought of integer -> float conversion errors, but they should affect both and i tried with floats, too.
Any idea how to render this correct?
Thanks in advance