The glLogicOp function specifies a logical pixel operation for color index rendering.
void WINAPI glLogicOp( GLenum opcode );
A symbolic constant that selects a logical operation. The following symbols are accepted where s equals the value of the source bit and d is the value of the destination bit.
s & d
!(s & d)
s | d
!(s | d)
s ^ d
!(s ^ d)
s & !d
!s & d
s | !d
!s | d
This function does not return a value.
The following error codes can be retrieved by the glGetError function.
||opcode was not an accepted value.
||The function was called between a call to glBegin and the corresponding call to glEnd.
The glLogicOp function specifies a logical operation that, when enabled, is applied between the incoming color index and the color index at the corresponding location in the framebuffer. The logical operation is enabled or disabled with glEnable and glDisable using the symbolic constant GL_LOGIC_OP.
The opcode parameter is a symbolic constant chosen from the list below. In the explanation of the logical operations, s represents the incoming color index and d represents the index in the framebuffer. Standard C-language operators are used. As these bitwise operators suggest, the logical operation is applied independently to each bit pair of the source and destination indexes.
Logical pixel operations are not applied to RGBA color buffers.
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 glDrawBuffer).
The opcode parameter must be one of the 16 accepted values. Other values result in an error.
The following functions retrieve information related to glLogicOp:
glGet with argument GL_LOGIC_OP_MODE
glIsEnabled with argument GL_LOGIC_OP
|Minimum supported client
||Windows 2000 Professional [desktop apps only]
|Minimum supported server
||Windows 2000 Server [desktop apps only]