I am writing a paint program in Delphi. The user clicks 2 points on the screen and a line is drawn between them. I want the lines to be anti-aliased. I put this code in create() procedure of the OpenGL class (which is called just 1 time in the start):
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
When I start drawing, the first, second and maybe the third lines are drawn fine. But interestingly enough, when the number of the lines increases (say 7, 8 lines), the anti-aliasing starts to fail! By adding each line on the screen, it just gets worse and the lines edges starts to become like sawtooth!!
I also put the same code on the top of my draw() procedure which draws the lines (and runs by each click of the mouse), but nothing changes.
Am I doing something wrong here? Anybody has any suggestion?