glRenderMode function

The glRenderMode function sets the rasterization mode.

Syntax

GLint WINAPI glRenderMode(
   GLenum mode
);

Parameters

mode

The rasterization mode. The following three values are accepted. The default value is GL_RENDER.

Value Meaning
GL_RENDER
Render mode. Primitives are rasterized, producing pixel fragments, which are written into the framebuffer. This is the normal mode and also the default mode.
GL_SELECT
Selection mode. No pixel fragments are produced, and no change to the framebuffer contents is made. Instead, a record of the names of primitives that would have been drawn if the render mode was 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 framebuffer contents is made. Instead, the coordinates and attributes of vertices that would have been drawn had the render mode been GL_RENDER are returned in a feedback buffer, which must be created (see glFeedbackBuffer) before feedback mode is entered.

Error codes

The following error codes can be retrieved by the glGetError function.

Name Meaning
GL_INVALID_ENUM
mode was not one of three accepted values.
GL_INVALID_OPERATION
The function was called with argument GL_SELECT before glSelectBuffer was called at least once.
GL_INVALID_OPERATION
The function was called with argument GL_FEEDBACK before glBeedbackBuffer was called at least once.
GL_INVALID_OPERATION
The function was called between a call to glBegin and the corresponding call to glEnd.

Remarks

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.

Value Meaning
GL_RENDER Zero.
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.

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

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Gl.h
Library
Opengl32.lib
DLL
Opengl32.dll

See also

glBegin

glEnd

glFeedbackBuffer

glInitNames

glLoadName

glPassThrough

glPushName

glSelectBuffer