[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glRenderMode Subroutine

Purpose

Sets rasterization mode.

Library

OpenGL C bindings library: libGL.a

C Syntax

GLint glRenderMode(GLenum Mode)

Parameters

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

Description

The glRenderMode subroutine sets the rasterization mode. It takes one argument, the Mode parameter, 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 was GL_RENDER is returned in a select buffer, which must be created before selection mode is entered. (See the glSelectBuffer subroutine for information about establishing a buffer for selection mode values.)
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 had the render mode been GL_RENDER are returned in a feedback buffer, which must be created before feedback mode is entered. (See the glFeedbackBuffer subroutine for information about controlling the feedback mode.)

The return value of glRenderMode is determined by the render mode at the time glRenderMode is called, rather than by the Mode parameter.

Refer to glSelectBuffer and glFeedbackBuffer for more details concerning selection and feedback operation.

Notes

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

Errors

GL_INVALID_ENUM Mode is not one of the three accepted values.
GL_INVALID_OPERATION The glSelectBuffer subroutine is called while the render mode is GL_SELECT, or glRenderMode is called with the GL_SELECT argument before glSelectBuffer is called at least once.
GL_INVALID_OPERATION The glFeedbackBuffer subroutine is called while the render mode is GL_FEEDBACK, or glRenderMode is called with the GL_FEEDBACK argument before glFeedbackBuffer is called at least once.
GL_INVALID_OPERATION The glRenderMode subroutine is called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

Associated gets for the glRenderMode subroutine are as follows. (See the glGet subroutine for more information.)

glGet with argument GL_RENDER_MODE.

Return Values

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.

Files

/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glBegin or glEnd subroutine, glFeedbackBuffer subroutine, glInitNames subroutine, glLoadName subroutine, glPassThrough subroutine, glPushName subroutine, glSelectBuffer subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]