glRenderMode

set rasterization mode

Signature

glRenderMode( GLenum ( mode ) )-> GLint
glRenderMode( newMode )
Change to the given rendering mode

    If the current mode is GL_FEEDBACK or GL_SELECT, return
    the current buffer appropriate to the mode
    

Parameters

VariablesDescription
mode
Specifies the rasterization mode. Three values are accepted: GL_RENDER , GL_SELECT , and GL_FEEDBACK . The initial value is GL_RENDER .

Description

glRenderMode 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 glSelectBuffer ) 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 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:
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 the glSelectBuffer and glFeedbackBuffer reference pages for more details concerning selection and feedback operation.

Notes

If an error is generated, glRenderMode returns 0 regardless of the current render mode.

Errors

GL_INVALID_ENUM is generated if mode is not one of the three accepted values.
GL_INVALID_OPERATION is generated if glSelectBuffer is called while the render mode is GL_SELECT , or if glRenderMode is called with argument GL_SELECT before glSelectBuffer is called at least once.
GL_INVALID_OPERATION is generated if glFeedbackBuffer is called while the render mode is GL_FEEDBACK , or if glRenderMode is called with argument GL_FEEDBACK before glFeedbackBuffer is called at least once.
GL_INVALID_OPERATION is generated if glRenderMode is executed between the execution of glBegin and the corresponding execution of glEnd .

Associated Gets

glGet with argument GL_RENDER_MODE

See Also

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glRenderMode
OpenGLContext OpenGLContext/passes/renderpass.py Lines: 313, 506, 551
OpenGLContext OpenGLContext/passes/rendervisitor.py Lines: 315
OpenGLContext tests/feedback_mode.py Lines: 13, 17, 24, 26, 36, 40
{LGPL} VisionEgg test/conform.py Lines: 110, 112, 259, 261
{LGPL or GPL or MPL} Kamaelia Code/Python/Kamaelia/Kamaelia/UI/OpenGL/OpenGLDisplay.py Lines: 784, 818
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Experiments/Cubes.py Lines: 309, 345
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/OpenGLDisplay.py Lines: 767, 796
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/playground/Display3D.py Lines: 453, 480
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/playground/Display3D.py Lines: 453, 480