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:
glVertex2d( 10.0f, 10.0f );
glVertex2d( 100.0f, 10.0f);

glVertex3f(10.0f, 10.f, 0.0f);
glVertex3f(100.0f, 10.0f, 0.0f);
glVertex3f(100.0f, 100.0f, 0.0f);

hope you understood my question and give me help.

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 .

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.