# Rounded and Square points

**URL:** <https://community.khronos.org/t/rounded-and-square-points/77249>\
**Category:** OpenGL: Basic Coding\
**Created:** [January 3, 2019, 10:29am UTC](https://community.khronos.org/t/rounded-and-square-points/77249 "2019-01-03T10:29:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pelaoqlo](https://community.khronos.org/user_avatar/community.khronos.org/pelaoqlo/32/233_2.png) [@pelaoqlo](https://community.khronos.org/u/pelaoqlo)\
**Post date:** [January 3, 2019, 10:29am UTC](https://community.khronos.org/t/rounded-and-square-points/77249/1 "2019-01-03T10:29:22Z")

</div>

Hi everyone!

I am use below code for draw rounded points,

```auto

          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:

```auto
glEnable(GL_POINTS)

```

i know the square point is painted: ■

and with

```auto

          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?😕 ☹ \*View gif.  
 ![roundedpoint123](https://community.khronos.org/uploads/default/original/2X/d/dcfb72020b463856e04b43932b58a009ff06f052.gif)

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

```auto

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

```

and my method for rounded point:

```auto

        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:

```auto

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

```

😃

---

<div class="post-metadata">

**Author:** ![GClements](https://community.khronos.org/letter_avatar_proxy/v4/letter/g/e0b2c6/32.png) [@GClements](https://community.khronos.org/u/GClements)\
**Post date:** [January 3, 2019, 2:16pm UTC](https://community.khronos.org/t/rounded-and-square-points/77249/2 "2019-01-03T14:16:30Z")

</div>

> [@pelaoqlo;1293345](#):
>
> My questions is, how do i prevent square point transform in rounded point when i paint a rounded point?

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.

---

<div class="post-metadata">

**Author:** ![pelaoqlo](https://community.khronos.org/user_avatar/community.khronos.org/pelaoqlo/32/233_2.png) [@pelaoqlo](https://community.khronos.org/u/pelaoqlo)\
**Post date:** [January 3, 2019, 2:26pm UTC](https://community.khronos.org/t/rounded-and-square-points/77249/3 "2019-01-03T14:26:35Z")

</div>

[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! 👼 It’s works, Thanks!
