Closed cylinder

Is anyone know if there exist a function like auxSolidCylinder that generate a cylinder that have caps. I mean, a closed cylinder.

I don’t think there is but you could try this:

glBegin (GL_QUAD_STRIP);
for (angle = 0; angle <= NumberOfPanels; angle ++)
{
glVertex3f (-CylinderLength,
sin (angle / NumberOfPanels * kPI) * CylinderCircumference,
cos (angle / NumberOfPanels * kPI) * CylinderCircumference);
glVertex3f (CylinderLength,
sin (angle / NumberOfPanels * kPI) * CylinderCircumference,
cos (angle / NumberOfPanels * kPI) * CylinderCircumference);
}
glVertex3f (-CylinderLength,
0, CylinderCircumference);
glVertex3f (CylinderLength,
0, CylinderCircumference);
glEnd ();
glBegin (GL_POLYGON);
for (angle = 0; angle <= NumberOfPanels; angle ++)
{
glVertex3f (-CylinderLength,
sin (angle / NumberOfPanels * kPI) * CylinderCircumference,
cos (angle / NumberOfPanels * kPI) * CylinderCircumference);
}
glVertex3f (-CylinderLength,
0, CylinderCircumference);
glEnd ();
glBegin (GL_POLYGON);
for (angle = 0; angle <= NumberOfPanels; angle ++)
{
glVertex3f (CylinderLength,
sin (angle / NumberOfPanels * kPI) * CylinderCircumference,
cos (angle / NumberOfPanels * kPI) * CylinderCircumference);
}
glVertex3f (CylinderLength,
0, CylinderCircumference);
glEnd ();

You would be better to precalculate all of the verticies and store them in a vertex array to make it run faster but the above should work.