I'm trying to code (in c, using opengl) a piece of a boardgame using GL_POINT for each piece. I have the following code:
glEnable(GL_POINT_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
glPointSize(20.0f);
glBegin(GL_POINTS);
glVertex2d(200, 200);
glEnd();
Bur for some reason the point always shows as a square, instead of a circle... Does anyone know why?
Actually, to get smoothing to work, you probably just need to enable blending. Try adding:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
I know this is necessary for line smoothing, and I'm pretty sure it's the same for points.
Cheers, -matt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With