GLLOGICOP(3G)

✨ NAME ✨

glLogicOp β€” specify a logical pixel operation for rendering. okay so this is the GLLOGICOP(3G) manual page, and yes the header lowkey has a [FIXME: manual] placeholder, but we move. πŸ’…

🌸 C SPECIFICATION 🌸

void glLogicOp(GLenum opcode);

πŸŽ€ PARAMETERS πŸŽ€

  • opcode β€” specifies a symbolic constant that selects a logical operation. The accepted symbols are: 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. no cap, that's the whole menu.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so 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.

Here's the iconic cheat sheet, bestie β€” s is the incoming color and d is the color in the frame buffer:

  • GL_CLEAR β€” 0
  • GL_SET β€” 1
  • GL_COPY β€” s
  • GL_COPY_INVERTED β€” ~s
  • GL_NOOP β€” d
  • GL_INVERT β€” ~d
  • GL_AND β€” s & d
  • GL_NAND β€” ~(s & d)
  • GL_OR β€” s | d
  • GL_NOR β€” ~(s | d)
  • GL_XOR β€” s ^ d
  • GL_EQUIV β€” ~(s ^ d)
  • GL_AND_REVERSE β€” s & ~d
  • GL_AND_INVERTED β€” ~s & d
  • GL_OR_REVERSE β€” s | ~d
  • GL_OR_INVERTED β€” ~s | d

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. it's giving bitwise realness, fr fr.

πŸ’œ NOTES πŸ’œ

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()).

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. πŸ’€

🚨 ERRORS 🚨

GL_INVALID_ENUM is generated if opcode is not an accepted value.

πŸ” ASSOCIATED GETS πŸ”

  • glGet() with argument GL_LOGIC_OP_MODE.
  • glIsEnabled() with argument GL_COLOR_LOGIC_OP.

πŸ‘‘ VERSION SUPPORT πŸ‘‘

Function / Feature Name: glLogicOp

  • OpenGL 2.0 β€” βœ”
  • OpenGL 2.1 β€” βœ”
  • OpenGL 3.0 β€” βœ”
  • OpenGL 3.1 β€” βœ”
  • OpenGL 3.2 β€” βœ”
  • OpenGL 3.3 β€” βœ”
  • OpenGL 4.0 β€” βœ”
  • OpenGL 4.1 β€” βœ”
  • OpenGL 4.2 β€” βœ”
  • OpenGL 4.3 β€” βœ”
  • OpenGL 4.4 β€” βœ”
  • OpenGL 4.5 β€” βœ”

🌈 SEE ALSO 🌈

  • glBlendFunc()
  • glDrawBuffer()
  • glEnable()
  • glStencilOp()

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 http://oss.sgi.com/projects/FreeB/.

Copyright Β© 1991-2006 Silicon Graphics, Inc.

Copyright Β© 2010-2014 Khronos Group

okay bye bestie πŸ’– β€” source/version: [FIXME: source]; date: 08/09/2021; manual: GLLOGICOP(3G). periodt.

πŸ“¦ where this page comes from