OpenGL: GL_LINE_SMOOTH is not supported on all maps; don't even draw lines, unless

First of all, what is the meaning of this code?

glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); 

I could put GL_DONT_CARE there, but it does not draw my lines , unless glDisable(GL_LINE_SMOOTH) used glDisable(GL_LINE_SMOOTH)

So I ask if there is any built-in mechanism to make it draw lines even if arent smooth lines are supported (so it will draw them without anti-alias ...)

Or do I need to make my own functions for it and check if smooth lines are supported, etc .... and every time I want to draw smooth lines, I need to call this function, which checks if it supports it? Argh.

Edit: Lines are smooth on my other map, they don’t even appear on my other map unless I turn off the smooth lines. So this is a problem, not glEnable (GL_BLEND)

+6
c ++ opengl lines
source share
1 answer

glHint , as the name suggests, is a driver . He does not need anything. The actual operation of glHint depends on the graphics driver.

In addition to enable LINE_SMOOTH ing, you need to enable blending. Have you turned on GL_BLEND ? And while you're on it, select the glBlend function too!

Example:

 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); 
+5
source share

All Articles