I found a solution, although it may not be the best one. Here is the entire function:
// draws a pointy-topped hexagon at (x,y,z) with <size> and <height>
// <size> is from the center to the corners, <height> is from the botom hex to the top hex (rectangles form the walls)
// drawn in the x-z plane with y as the height
void drawHexagon(GLfloat center_x, GLfloat center_y, GLfloat center_z, GLfloat size, GLfloat height, GLfloat* color)
{
glPushMatrix();
{
glColor3f(color[0], color[1], color[2]);
GLfloat firstHex[6][3];
GLfloat secondHex[6][3];
glBegin(GL_POLYGON);
{
for (GLint i = 0; i < 6; i++)
{
GLfloat angle = 2 * PI / 6 * (i + 0.5);
GLfloat x_tempVertex = center_x + size * cos(angle);
GLfloat z_tempVertex = center_z + size * sin(angle);
firstHex[i][0] = x_tempVertex;
firstHex[i][1] = center_y;
firstHex[i][2] = z_tempVertex;
glVertex3f(x_tempVertex, center_y, z_tempVertex);
}
}
glEnd();
glBegin(GL_POLYGON);
{
for (GLint i = 0; i < 6; i++)
{
GLfloat angle = 2 * PI / 6 * (i + 0.5);
GLfloat x_tempVertex = center_x + size * cos(angle);
GLfloat z_tempVertex = center_z + size * sin(angle);
secondHex[i][0] = x_tempVertex;
secondHex[i][1] = center_y + height;
secondHex[i][2] = z_tempVertex;
glVertex3f(x_tempVertex, center_y+height, z_tempVertex);
}
}
glEnd();
// Begin filling the rectangles between the two hexagons
// drawing begins at ( 0, 0, 0 ) and moves clockwise
// ( 0, 0, 1 ) [the mid single coord in each set represents the middle point up/down respectivly]
glColor3f(1,1,1);
glBegin(GL_QUADS);
{
for (GLint i = 0; i < 5; i++)
{
glVertex3f(firstHex[i][0], firstHex[i][1], firstHex[i][2]); // top left
glVertex3f(secondHex[i][0], secondHex[i][1], secondHex[i][2]); // bottom left
glVertex3f(secondHex[i+1][0], secondHex[i+1][1], secondHex[i+1][2]); // top right
glVertex3f(firstHex[i+1][0], firstHex[i+1][1], firstHex[i+1][2]); // bottom right
}
// corner case (connecting the end to the beginning)
glVertex3f(firstHex[5][0], firstHex[5][1], firstHex[5][2]); // top left
glVertex3f(secondHex[5][0], secondHex[5][1], secondHex[5][2]); // bottom left
glVertex3f(secondHex[0][0], secondHex[0][1], secondHex[0][2]); // top right
glVertex3f(firstHex[0][0], firstHex[0][1], firstHex[0][2]); // bottom right
}
glEnd();
}
glPopMatrix();
}
(I know that the {} for glBegin/glEnd and glPushMatrix/glPopMatrix are not necessary, but they do help readability in an IDE immensely)