GLLOGICOP(3G)

    .SH "NAME" glLogicOp - specify a logical pixel operation for rendering
    .SH "C SPECIFICATION"

            .HP u void glLogicOp(GLenum opcode);

    .SH "PARAMETERS"

        .PP opcode

                    Specifies a symbolic constant that selects a logical operation. The following symbols are accepted: GL_CLEAR, GL_SET, GL_COPY, GL_COPY_INVERTED, GL_NOOP, GL_INVERT, GL_AND, GL_NAND, GL_OR, GL_NOR, GL_XOR, GL_EQUIV, GL_AND_REVERSE, GL_AND_INVERTED, GL_OR_REVERSE, and GL_OR_INVERTED. The initial value is GL_COPY.

            .RE

        .SH "DESCRIPTION"
            .PP glLogicOp specifies a logical operation that, when enabled, is applied between the incoming RGBA color and the RGBA color at the corresponding location in the frame buffer. To enable or disable the logical operation, call glEnable() and glDisable using the symbolic constant GL_COLOR_LOGIC_OP. The initial value is disabled.
            .PP
            .TS allbox tab(:); lB cB. T{ Opcode T}:T{ Resulting Operation T} l c l c l c l c l c l c l c l c l c l c l c l c l c l c l c l c. T{ GL_CLEAR T}:T{ 0 T} T{ GL_SET T}:T{ 1 T} T{ GL_COPY T}:T{ s T} T{ GL_COPY_INVERTED T}:T{ ~s T} T{ GL_NOOP T}:T{ d T} T{ GL_INVERT T}:T{ ~d T} T{ GL_AND T}:T{ s & d T} T{ GL_NAND T}:T{ ~(s & d) T} T{ GL_OR T}:T{ s | d T} T{ GL_NOR T}:T{ ~(s | d) T} T{ GL_XOR T}:T{ s ^ d T} T{ GL_EQUIV T}:T{ ~(s ^ d) T} T{ GL_AND_REVERSE T}:T{ s & ~d T} T{ GL_AND_INVERTED T}:T{ ~s & d T} T{ GL_OR_REVERSE T}:T{ s | ~d T} T{ GL_OR_INVERTED T}:T{ ~s | d T}

            .PP opcode is a symbolic constant chosen from the list above. In the explanation of the logical operations, s represents the incoming color and d represents the color 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 colors.

        .SH "NOTES"
            .PP When more than one RGBA color 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 glDrawBuffer()).
            .PP Logic operations have no effect on floating point draw buffers. However, if GL_COLOR_LOGIC_OP is enabled, blending is still disabled in this case.

        .SH "ERRORS"
            .PP GL_INVALID_ENUM is generated if opcode is not an accepted value.

        .SH "ASSOCIATED GETS"
            .PP glGet() with argument GL_LOGIC_OP_MODE.
            .PP glIsEnabled() with argument GL_COLOR_LOGIC_OP.

        .SH "VERSION SUPPORT"
            .TS allbox tab(:); lB cB s s s s s s s s s s s lB cB cB cB cB cB cB cB cB cB cB cB cB. T{ T}:T{ OpenGL Version T} T{ Function / Feature Name T}:T{ 2.0 T}:T{ 2.1 T}:T{ 3.0 T}:T{ 3.1 T}:T{ 3.2 T}:T{ 3.3 T}:T{ 4.0 T}:T{ 4.1 T}:T{ 4.2 T}:T{ 4.3 T}:T{ 4.4 T}:T{ 4.5 T} l c c c c c c c c c c c c. T{ glLogicOp T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}:T{ ✔ T}

        .SH "SEE ALSO"
            .PP glBlendFunc(), glDrawBuffer(), glEnable(), glStencilOp()

        .SH "COPYRIGHT"
            .PP Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2010-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see https://khronos.org/registry/OpenGL-Refpages/LICENSES/LicenseRef-FreeB.txt.

COPYRIGHT
Copyright © 1991-2006 Silicon Graphics, Inc.
Copyright © 2010-2014 Khronos Group