Pixel width with glPointSize - no effect

I have this code for reset points. I want to increase the size of the point. I am using this glPointSize command glPointSize , but nothing is happening. The default point size. It does not increase.
How to increase the size of a point?

 glBegin(GL_POINTS); glColor3f (a, b, c); glPointSize(20.0f); glVertex2i(px, py); glEnd(); 
+6
source share
1 answer

glPointSize(20.0f); must be placed before glBegin() , otherwise it will have no effect. Do it like this:

 glPointSize(20.0f); glBegin(GL_POINTS); glColor3f (a, b, c); glVertex2i(px, py); glEnd(); 

In the OpenGL documentation, you can read that:

For glBegin and glEnd, only a subset of GL commands can be used. Commands: glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glArrayElement, glMaterial and glEdgeFlag. In addition, it is acceptable to use glCallList or glCallLists to execute display lists containing only previous commands. If any other GL command is executed between glBegin and glEnd, the error flag is set and the command is ignored.

+12
source

All Articles