get the POLYGON MODE

Hi,

I have been trying to get the poygon mode from opengl. How do we get the proper GLenum
value for the 2 symbolic constants indicating whether front-facing and back-facing polygons are rasterized as points, lines, or filled polygons.

Code:
GLint polygonMode[2];
glGetIntegerv(GL_POLYGON_MODE, polygonMode);

Can anyone tell how do we get thhat 2 constants?

R.B

GLint polygonMode;
glGetIntegerv(GL_POLYGON_MODE, &polygonMode);

if ( polyMode == GL_LINE )
;//
if ( polyMode == GL_FILL )
;//
if ( polyMode == GL_POINTS )
;//

Sorry for bumping this 23 year old thread, but this response is wrong and it appears as the first google response to any search about opengl get polygon mode.

To get the polygon mode, you need to declare the polygonMode as an array of two elements or it will cause a buffer overflow:

GLint polygonMode[2];
glGetIntegerv(GL_POLYGON_MODE, polygonMode);

This buffer overflow wasted me a whole day.

It doesn’t help that the current glGet reference page doesn’t actually document GL_POLYGON_MODE, although the legacy (2.1) reference page does.