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