NAME

glLogicOp - specify a logical pixel operation for color index rendering

C SPECIFICATION

void ggllLLooggiiccOOpp( GLenum _o_p_c_o_d_e )

        

PARAMETERS

_o_p_c_o_d_e
Specifies a symbolic constant that selects a logical operation. The following symbols are accepted: GGLL__CCLLEEAARR, GGLL__SSEETT, GGLL__CCOOPPYY, GGLL__CCOOPPYY__IINNVVEERRTTEEDD, GGLL__NNOOOOPP, GGLL__IINNVVEERRTT, GGLL__AANNDD, GGLL__NNAANNDD, GGLL__OORR, GGLL__NNOORR, GGLL__XXOORR, GGLL__EEQQUUIIVV, GGLL__AANNDD__RREEVVEERRSSEE, GGLL__AANNDD__IINNVVEERRTTEEDD, GGLL__OORR__RREEVVEERRSSEE, and GGLL__OORR__IINNVVEERRTTEEDD. The initial value is GGLL__CCOOPPYY.

DESCRIPTION

ggllLLooggiiccOOpp specifies a logical operation that, when enabled, is applied between the incoming color index or RGBA color and the color index or RGBA color at the corresponding location in the frame buffer. To enable or disable the logical operation, call ggllEEnnaabbllee and ggllDDiissaabbllee using the symbolic constant GGLL__CCOOLLOORR__LLOOGGIICC__OOPP for RGBA mode or GGLL__IINNDDEEXX__LLOOGGIICC__OOPP for color index mode. The initial value is disabled for both operations.

center;
lb lb
l c.
_
Opcode  Resulting Operation
_
GGLL__CCLLEEAARR        0
GGLL__SSEETT  1
GGLL__CCOOPPYY s
GGLL__CCOOPPYY__IINNVVEERRTTEEDD        ~s
GGLL__NNOOOOPP d
GGLL__IINNVVEERRTT       ~d
GGLL__AANNDD  s & d
GGLL__NNAANNDD ~(s & d)
GGLL__OORR   s | d
GGLL__NNOORR  ~(s | d)
GGLL__XXOORR  s ^ d
GGLL__EEQQUUIIVV        ~(s ^ d)
GGLL__AANNDD__RREEVVEERRSSEE  s & ~d
GGLL__AANNDD__IINNVVEERRTTEEDD ~s & d
GGLL__OORR__RREEVVEERRSSEE   s | ~d
GGLL__OORR__IINNVVEERRTTEEDD  ~s | d
_

_o_p_c_o_d_e is a symbolic constant chosen from the list above. 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 bitwise operators suggest, the logical operation is applied independently to each bit pair of the source and destination indices or colors.

NOTES

Color index logical operations are always supported. RGBA logical operations are supported only if the GL version is 1.1 or greater.

When more than one RGBA color or index buffer is enabled for drawing, logical operations are performed separately for each enabled buffer, using for the destination value the contents of that buffer (see ggllDDrraawwBBuuffffeerr).

ERRORS

GGLL__IINNVVAALLIIDD__EENNUUMM is generated if _o_p_c_o_d_e is not an accepted value.

GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllLLooggiiccOOpp is executed between the execution of ggllBBeeggiinn and the corresponding execution of ggllEEnndd.

ASSOCIATED GETS

ggllGGeett with argument GGLL__LLOOGGIICC__OOPP__MMOODDEE.
ggllIIssEEnnaabblleedd with argument GGLL__CCOOLLOORR__LLOOGGIICC__OOPP or GGLL__IINNDDEEXX__LLOOGGIICC__OOPP.

SEE ALSO

ggllAAllpphhaaFFuunncc((33GG)), ggllBBlleennddFFuunncc((33GG)), ggllDDrraawwBBuuffffeerr((33GG)), ggllEEnnaabbllee((33GG)), ggllSStteenncciillOOpp((33GG))