Hey, currently I'm using this code to draw a line:
I've tried line smoothing and such but it produces no results. Anyone have any tips on getting a smooth line?
Thanks,
-Matt
Code:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// Enable blending as we want the transparent parts of the image to be transparent
glEnable(GL_BLEND);
glEnableClientState(GL_VERTEX_ARRAY);
GLfloat* vertices;
vertices = (float *)malloc(2*2 * sizeof(float));
vertices[0] = point1.x;
vertices[1] = 320-point1.y;
vertices[2] = point2.x;
vertices[3] = 320-point2.y;
glVertexPointer(2, GL_FLOAT, 0, vertices);
glLineWidth(1.0*width);
glColor4f(color[0], color[1], color[2], color[3]*0.5);
glDrawArrays(GL_LINE_STRIP, 0, 2);
free(vertices);
glDisableClientState(GL_VERTEX_ARRAY);
// Now we are done drawing disable blending
glDisable(GL_BLEND);
I've tried line smoothing and such but it produces no results. Anyone have any tips on getting a smooth line?
Thanks,
-Matt