Problem of drawing line

i draw a line with points (10,10),(100,10) first
,then draw a triangle with points as (10,10),
(100,10),(100,100).Does the triangle cover the line? i have tested this on different video cards and had different results.On intel 82865 card the line draws beside the triangle, and on sis(*) card the line is covered with the triangle.How to resolve this difference?

Code like that:
glBegin(GL_LINES);
glVertex2d( 10.0f, 10.0f );
glVertex2d( 100.0f, 10.0f);
glEnd();

glBegin(GL_TRIANGLE_STRIP);
glVertex3f(10.0f, 10.f, 0.0f);
glVertex3f(100.0f, 10.0f, 0.0f);
glVertex3f(100.0f, 100.0f, 0.0f);
glEnd();

hope you understood my question and give me help.
thanks.

That’s it! I’m outa here… :mad:

If you are using orthographic projection, and you want predictable rasterization, per the rules in the spec you need to draw points and lines on 0.5 px centers, and triangles/quads/polygons on 0.0 px corners.

Otherwise, the position of the point/line (after mvp projection and viewport transform) may be rounded up or down to the nearest integer pixel, it is implementation dependent which way it goes.

This is also a FAQ. See 14.120 .

Cool!!
Thanks arekkusu very much!

Please consider that this is an advanced forum and there is another forum for where this would have been a suitable post.

In future please post questions like this only in the beginner’s forum.

I’m moving this thread to beginners.