#include #include #include #include void init (void) { glClearColor (1.0, 1.0, 1.0, 0.0); glOrtho (0.0, 1.0, 0.0, 1.0, -1.0, 1.0); // Here lies the cause of my troubles glEnable (GL_LINE_SMOOTH); glEnable (GL_BLEND); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glHint (GL_LINE_SMOOTH_HINT, GL_NICEST); } void display (void) { // Just draw a black line on white background glClear (GL_COLOR_BUFFER_BIT); glColor3f (0.0, 0.0, 0.0); glLineWidth (1); glBegin (GL_LINE_STRIP); glVertex3f (0.50, 0.0, 1.0); glVertex3f (0.51, 1.0, 0.0); glEnd (); glFlush (); } int main(int argc, char** argv) { // Standard GLUT init glutInit (&argc, argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (250, 250); glutInitWindowPosition (100, 100); glutCreateWindow ("hello"); init (); glutDisplayFunc (display); glutMainLoop (); return 0; }