GlEnable GL_LINE_SMOOTH

BlitzMax Forums/BlitzMax Beginners Area/GlEnable GL_LINE_SMOOTH

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You need to make sure you've got blending switched on, but sometimes graphics card drivers switch line anti-aliasing off anyway.

This is what they do in the OpenGL Red Book:
glEnable (GL_LINE_SMOOTH);
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
glLineWidth (1.5);

But I'd also change "GL_DONT_CARE" to "GL_NICEST".

Sometimes line anti-aliasing just doesn't work, and it's not particularly fast. I've seen a clever hack that uses a thin alpha-blended texture instead on a line, which is often faster, believe it or not.