Name
gl.RenderMode -- set rasterization mode
Synopsis
r = gl.RenderMode(mode)
Function
gl.RenderMode() sets the rasterization mode. It takes one argument, mode, which can assume one of three predefined values:

#GL_RENDER
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.

#GL_SELECT
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 #GL_RENDER is returned in a select buffer, which must be created (See gl.SelectBuffer for details.) before selection mode is entered.

#GL_FEEDBACK
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 #GL_RENDER is returned in a feedback buffer, which must be created (See gl.FeedbackBuffer for details.) before feedback mode is entered.

The return value of gl.RenderMode() is determined by the render mode at the time gl.RenderMode() is called, rather than by mode. The values returned for the three render modes are as follows:

#GL_RENDER
0.

#GL_SELECT
The number of hit records transferred to the select buffer.

#GL_FEEDBACK
The number of values (not vertices) transferred to the feedback buffer.

See gl.SelectBuffer for more details concerning selection operation.

See gl.FeedbackBuffer for more details concerning feedback operation.

If an error is generated, gl.RenderMode() returns 0 regardless of the current render mode.

Please consult an OpenGL reference manual for more information.

Inputs
mode
specifies the rasterization mode; the initial value is #GL_RENDER (see above)
Results
r
return code (see above)
Errors
#GL_INVALID_ENUM is generated if mode is not one of the three accepted values.

#GL_INVALID_OPERATION is generated if gl.SelectBuffer() is called while the render mode is #GL_SELECT, or if gl.RenderMode() is called with argument #GL_SELECT before gl.SelectBuffer() is called at least once.

#GL_INVALID_OPERATION is generated if gl.FeedbackBuffer() is called while the render mode is #GL_FEEDBACK, or if gl.RenderMode() is called with argument #GL_FEEDBACK before gl.FeedbackBuffer() is called at least once.

#GL_INVALID_OPERATION is generated if gl.RenderMode() is executed between the execution of gl.Begin() and the corresponding execution of gl.End().

Associated gets
gl.Get() with argument #GL_RENDER_MODE


Show TOC