Rounded and Square points

Hi everyone!

I am use below code for draw rounded points,


          glEnable(GL_POINT_SMOOTH);
          glEnable(GL_BLEND);
          glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

but, i need to paint two different points, one square and one rounded.

Example, when use only:

glEnable(GL_POINTS)

i know the square point is painted: ■

and with


          glEnable(GL_POINT_SMOOTH);
          glEnable(GL_BLEND);
          glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

i know the rounded point is painted: ●

My questions is, how do i prevent square point transform in rounded point when i paint a rounded point?:confused: :frowning: *View gif.
roundedpoint123

I have 2 methods for painting diferents objects
my method for square point:


        MyClass::squarePoint()
        {
            glPointSize(10.0);
            glEnable(GL_PROGRAM_POINT_SIZE);
            glBegin(GL_POINTS);
            glEnd();
        }

and my method for rounded point:


        MyClass::roundedPoint()
        {
            glPointSize(10.0);
            glEnable(GL_PROGRAM_POINT_SIZE);
            glEnable(GL_POINT_SMOOTH);
            glEnable(GL_BLEND);
            glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
            glBegin(GL_POINTS);
            glEnd();
        }

and my paintGL method just in case:


        MyClass::paintGL()
        {
            this->squarePoint();
            this->roundedPoint();
        }

:smiley:

Call glDisable(GL_POINT_SMOOTH) to draw square points.

Point smoothing is initially disabled, so you get square points at first. But once you turn the feature on, it stays on until you turn it off. OpenGL state isn’t automatically reset between frames.

[QUOTE=GClements;1293348]Call glDisable(GL_POINT_SMOOTH) to draw square points.

Point smoothing is initially disabled, so you get square points at first. But once you turn the feature on, it stays on until you turn it off. OpenGL state isn’t automatically reset between frames.[/QUOTE]

You are my god in OpenGL! :angel: It’s works, Thanks!