glRenderMode(3G) OpenGL Reference glRenderMode(3G)
NAME
glRenderMode - set rasterization mode
C SPECIFICATION
GLint glRenderMode( GLenum mode )
PARAMETERS
mode Specifies the rasterization mode. Three values are accepted:
GLRENDER, GLSELECT, and GLFEEDBACK. The initial value is
GLRENDER.
DESCRIPTION
glRenderMode sets the rasterization mode. It takes one argument, mode,
which can assume one of three predefined values:
GLRENDER Render mode. Primitives are rasterized, producing pixel
fragments, which are written into the frame buffer. This
is the normal mode and also the default mode.
GLSELECT Selection mode. No pixel fragments are produced, and no
change to the frame buffer contents is made. Instead, a
record of the names of primitives that would have been
drawn if the render mode had been GLRENDER is returned
in a select buffer, which must be created (see
glSelectBuffer) before selection mode is entered.
GLFEEDBACK Feedback mode. No pixel fragments are produced, and no
change to the frame buffer contents is made. Instead,
the coordinates and attributes of vertices that would
have been drawn if the render mode had been GLRENDER is
returned in a feedback buffer, which must be created (see
glFeedbackBuffer) before feedback mode is entered.
The return value of glRenderMode 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:
GLRENDER 0.
GLSELECT The number of hit records transferred to the select
buffer, or -1 if the selection data required more room
than was available in the selection buffer.
GLFEEDBACK The number of values (not vertices) transferred to the
feedback buffer, or -1 if the feedback data required more
room than was available in the feedback buffer.
See the glSelectBuffer and glFeedbackBuffer reference pages for more
details concerning selection and feedback operation.
Page 1
glRenderMode(3G) OpenGL Reference glRenderMode(3G)
NOTES
If an error is generated, glRenderMode returns 0 regardless of the
current render mode.
One particularly surprising error condition occurs when the selection or
feedback buffer is too large for the implementation to handle. The
problem might not be detected until glRenderMode is executed, because
buffer memory might not be allocated or locked down until that time. In
such a case, it is possible that the only indication of the error is that
glRenderMode will return zero. Thus it is especially important to check
the return value.
ERRORS
GLINVALIDENUM is generated if mode is not one of the three accepted
values.
GLINVALIDOPERATION is generated if glSelectBuffer is called while the
render mode is GLSELECT, or if glRenderMode is called with argument
GLSELECT before glSelectBuffer is called at least once.
GLINVALIDOPERATION is generated if glFeedbackBuffer is called while the
render mode is GLFEEDBACK, or if glRenderMode is called with argument
GLFEEDBACK before glFeedbackBuffer is called at least once.
GLINVALIDOPERATION is generated if glRenderMode is executed between the
execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GLRENDERMODE
SEE ALSO
glFeedbackBuffer, glInitNames, glLoadName, glPassThrough, glPushName,
glSelectBuffer
Page 2