PDA

View Full Version : GL_LINES on different positions



Thomas Alton
12-22-2011, 10:30 AM
In my OpenGL program I draw lines using glBegin(GL_LINES)

I have tested this program on two different computers. All lines are drawn one pixel below on the first computer compared to the second computer. Why are the lines not drawn in the same position on both computers? Is it possible to make sure that the lines are drawn at the same position on both computers?

arekkusu
12-22-2011, 11:08 AM
Read the section of the specification about line rasterization.

Then draw your lines on pixel centers, instead of pixel corners.

Thomas Alton
12-22-2011, 12:51 PM
Thanks a lot for your reply! I really appreciate it.



Then draw your lines on pixel centers, instead of pixel corners.


Do you by this mean that I should use coordinate values like 100.5, 102.5, 110.5 instead of 100, 102, 110?

awhig
12-22-2011, 01:17 PM
Yes.