Specifies a logical pixel operation for color index rendering.
OpenGL C bindings library: libGL.a
void LogicOp(GLenum OperatorCode)
OperatorCode | Specifies a symbolic constant that selects a logical operation. The following symbols are accepted: |
The glLogicOp subroutine specifies a logical operation that, when enabled, is applied between the incoming color and the color at the corresponding location in the frame buffer. The logical operation is enabled or disabled with the glEnable and glDisable subroutines using the GL_LOGIC_OP symbolic constant for color index mode or the GL_COLOR_LOGIC_OP for RGB mode.
The OperatorCode parameter specifies a symbolic constant chosen from the following list. In the explanation of the logical operations, s represents the incoming color index and d represents the index in the frame buffer. Standard C-language operators are used. As these bit-wise operators suggest, the logical operation is applied independently to each bit pair of the source and destination indexes.
When more than one color index buffer is enabled for drawing, logical operations are done separately for each enabled buffer, using the contents of that buffer for the destination index. (See the glDrawBuffer subroutine for information about specifying color buffers for drawing.)
The OperatorCode parameter must be one of the 16 accepted values. Other values result in an error.
GL_INVALID_ENUM | OperatorCode is not an accepted value. |
GL_INVALID_OPERATION | The glLogicOp subroutine is called between a call to glBegin and the corresponding call to glEnd. |
Associated gets for the glLogicOp subroutine are as follows. (See the glGet subroutine for more information.)
glEnable or glDisable with argument GL_COLOR_LOGIC_OP for RGB mode or GL_INDEX_LOGIC_OP for color index mode.
glGet with argument GL_LOGIC_OP_MODE
glIsEnabled with argument GL_LOGIC_OP.
/usr/include/GL/gl.h | Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. |
The glAlphaFunc subroutine, glBegin or glEnd subroutine, glBlendEquationEXT subroutine, glBlendFunc subroutine, glDrawBuffer subroutine, glEnable or Disable subroutine, glStencilOp subroutine.