Line stippling not working

Hi,
I have the following code demoonstrating antialiasing and stippling:

glLoadIdentity();
glTranslatef(-2.5, 5.0, 0.0);
glColor3f(1.0, 1.0, 0.0);
glDisable(GL_POINT_SMOOTH);
glPointSize(10.0);
glBegin(GL_POINTS);
	glVertex2f(-1.0, 1.0);
	glVertex2f(2.0, 2.0);
	glVertex2f(0.0, 0.0);
	glVertex2f(1.0, -1.0);
	glVertex2f(-2.0, -2.0);
glEnd();

glLoadIdentity();
glTranslatef(2.5, 5.0, 0.0);
glColor3f(1.0, 0.75, 0.0);
glEnable(GL_POINT_SMOOTH);
glBegin(GL_POINTS);
	glVertex2f(-1.0, 1.0);
	glVertex2f(2.0, 2.0);
	glVertex2f(0.0, 0.0);
	glVertex2f(1.0, -1.0);
	glVertex2f(-2.0, -2.0);
glEnd();

glLoadIdentity();
glTranslatef(-2.5, 0.0, 0.0);

glColor3f(1.0, 1.0, 0.0);
glDisable(GL_LINE_SMOOTH);
glDisable(GL_LINE_STIPPLE);
glLineWidth(10.0);
glBegin(GL_LINE_STRIP);
	glVertex2f(-1.0, 1.0);
	glVertex2f(2.0, 2.0);
	glVertex2f(0.0, 0.0);
	glVertex2f(1.0, -1.0);
	glVertex2f(-2.0, -2.0);
glEnd();

glLoadIdentity();
glTranslatef(2.5, 0.0, 0.0);
glColor3f(1.0, 0.75, 0.0);
glEnable(GL_LINE_SMOOTH);
glBegin(GL_LINE_STRIP);
	glVertex2f(-1.0, 1.0);
	glVertex2f(2.0, 2.0);
	glVertex2f(0.0, 0.0);
	glVertex2f(1.0, -1.0);
	glVertex2f(-2.0, -2.0);
glEnd();

glLoadIdentity();
glTranslatef(-2.5, -5.0, 0.0);
glColor3f(0.0, 1.0, 0.0);
glLineWidth(1.0);
glEnable(GL_LINE_STIPPLE);
glLineStipple(2, 0x3F07);
glBegin(GL_LINE_STRIP);
	glVertex2f(-1.0, 1.0);
	glVertex2f(2.0, 2.0);
	glVertex2f(0.0, 0.0);
	glVertex2f(1.0, -1.0);
	glVertex2f(-2.0, -2.0);
glEnd();

glLoadIdentity();
glTranslatef(2.5, -5.0, 0.0);
glLineStipple(2, 0x0C0F);
glBegin(GL_LINE_STRIP);
	glVertex2f(-1.0, 1.0);
	glVertex2f(2.0, 2.0);
	glVertex2f(0.0, 0.0);
	glVertex2f(1.0, -1.0);
	glVertex2f(-2.0, -2.0);
glEnd();

I set up an otho-screen and everything is drawn, but some things are just not working:

GL_POINT_SMOOTH has no effect at all - thy look exactly the same

GL_LINE_SMOOTH lookes weired, somewhat like blended, but blending is turned off.

the last lines are not stippled at all either, stippling is not working

I desperately tried everything, turning line_smoothing on and off.

Does anyone know how to get those lines stippeled, or had the same problem?

(Win98,ATI Rage 128 Pro,MSVC++)

Thanks,
Zeog

Hi !

You don’t have the hint flags set to fast or something like that maybe ?

Mikael

I turned GL_POINT_SMOOTH_HINT as well as GL_LINE_SMOOTH_HINT to GL_NICEST (and PERSPECTIVE_CORRECTION) but those huge Points look still the same as the aliased ones and the smoothed Line has still a stipe pattern and looks like blended.
And it doesn’t help me with my stippling not being done.
But thanks.

Does it work when you turn off antialiasing?

did u turn on blending with src_alpha,1-src_alpha
check the faq for details

No, blending is entirely turned off.
But I spend some time to download drivers and now i get a rather stippled line.
But the antialiased line is now only 1 pixel wide, and those points are still squares.

Blending is required to make anti-aliasing work. A blend equation of GL_SRC_ALPHA & GL_ONE_MINUS_SRC_ALPHA usually works.