The glRenderMode function sets the rasterization mode.
GLint glRenderMode(
GLenum mode
);
The glRenderMode function takes one argument, mode, which can assume one of three predefined values above.
The return value of the glRenderMode function is determined by the render mode at the time glRenderMode is called, rather than by mode. The values returned for the three render modes are as follows:
Refer to glSelectBuffer and glFeedbackBuffer for more details concerning selection and feedback operation.
If an error is generated, glRenderMode returns zero regardless of the current render mode.
The following function retrieves information related to glRenderMode:
glGet with argument GL_RENDER_MODE
The following are the error codes generated and their conditions.
Error Code | Condition |
---|---|
GL_INVALID_ENUM | mode was not one of the three accepted values. |
GL_INVALID_OPERATION | glSelectBuffer was called while the render mode was GL_SELECT, or if glRenderMode was called with argument GL_SELECT before glSelectBuffer was called at least once. |
GL_INVALID_OPERATION | glFeedbackBuffer was called while the render mode was GL_FEEDBACK, or if glRenderMode was called with argument GL_FEEDBACK before glFeedbackBuffer was called at least once. |
GL_INVALID_OPERATION | glRenderMode was called between a call to glBegin and the corresponding call to glEnd. |
Windows NT: Use version 3.5 and later.
Windows: Use Windows 95 and later.
Windows CE: Unsupported.
Header: Declared in gl.h.
Import Library: Link with opengl32.lib.
glBegin, glEnd, glFeedbackBuffer, glInitNames, glLoadName, glPassThrough, glPushName, glSelectBuffer