com.io7m.jcanephora.core.api

## Interface JCGLStencilBuffersType

-     public interface JCGLStencilBuffersType

  OpenGL interface to stencil buffers.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `stencilBufferClear(int stencil)` Clear the stencil buffer with the specified value `stencil`.
    `void` | `stencilBufferDisable()` Disable the stencil test.
    `void` | `stencilBufferEnable()` Enable the stencil test.
    `void` | `stencilBufferFunction(JCGLFaceSelection faces, JCGLStencilFunction function, int reference, int mask)` Set the stencil function and reference value for the faces given by `faces`.
    `int` | `stencilBufferGetBits()`
    `JCGLStencilFunction` | `stencilBufferGetFunctionBack()`
    `JCGLStencilFunction` | `stencilBufferGetFunctionFront()`
    `int` | `stencilBufferGetFunctionMaskBack()`
    `int` | `stencilBufferGetFunctionMaskFront()`
    `int` | `stencilBufferGetFunctionReferenceBack()`
    `int` | `stencilBufferGetFunctionReferenceFront()`
    `int` | `stencilBufferGetMaskBackFaces()`
    `int` | `stencilBufferGetMaskFrontFaces()`
    `JCGLStencilOperation` | `stencilBufferGetOperationDepthFailBack()`
    `JCGLStencilOperation` | `stencilBufferGetOperationDepthFailFront()`
    `JCGLStencilOperation` | `stencilBufferGetOperationPassBack()`
    `JCGLStencilOperation` | `stencilBufferGetOperationPassFront()`
    `JCGLStencilOperation` | `stencilBufferGetOperationStencilFailBack()`
    `JCGLStencilOperation` | `stencilBufferGetOperationStencilFailFront()`
    `boolean` | `stencilBufferIsEnabled()`
    `void` | `stencilBufferMask(JCGLFaceSelection faces, int mask)` Control the writing of bits in the stencil buffer for the faces given by `faces`.
    `void` | `stencilBufferOperation(JCGLFaceSelection faces, JCGLStencilOperation stencil_fail, JCGLStencilOperation depth_fail, JCGLStencilOperation pass)` Configure the operations to be performed on the stencil buffer for the faces given by `faces`.

- - ### Method Detail

    - #### stencilBufferClear

          void stencilBufferClear(int stencil)
                           throws JCGLException,
                                  JCGLExceptionNoStencilBuffer

      Clear the stencil buffer with the specified value `stencil`.
      Parameters:
        `stencil` - The stencil value.
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionNoStencilBuffer` - If no stencil buffer is available

    - #### stencilBufferDisable

          void stencilBufferDisable()
                             throws JCGLException,
                                    JCGLExceptionNoStencilBuffer

      Disable the stencil test.
      Throws:
        `JCGLException` - Iff an internal OpenGL error occurs
        `JCGLExceptionNoStencilBuffer` - If no stencil buffer is available

    - #### stencilBufferEnable

          void stencilBufferEnable()
                            throws JCGLException,
                                   JCGLExceptionNoStencilBuffer

      Enable the stencil test.
      Throws:
        `JCGLException` - Iff an internal OpenGL error occurs
        `JCGLExceptionNoStencilBuffer` - If no stencil buffer is available

    - #### stencilBufferFunction

          void stencilBufferFunction(JCGLFaceSelection faces,
                                     JCGLStencilFunction function,
                                     int reference,
                                     int mask)
                              throws JCGLException,
                                     JCGLExceptionNoStencilBuffer

      Set the stencil function and reference value for the faces given by `faces`. The value `mask` is ANDed with the reference value and the stored stencil buffer value when `function` is evaluated.
      Parameters:
        `faces` - The face selection
        `function` - The stencil function
        `reference` - The reference value
        `mask` - The value to AND with the reference and stored stencil values
      Throws:
        `JCGLException` - Iff an internal OpenGL error occurs
        `JCGLExceptionNoStencilBuffer` - If no stencil buffer is available

    - #### stencilBufferGetBits

          int stencilBufferGetBits()
                            throws JCGLException

      Returns:
        The number of bits available in the stencil buffer for the current framebuffer configuration
      Throws:
        `JCGLException` - Iff an OpenGL error occurs

    - #### stencilBufferIsEnabled

          boolean stencilBufferIsEnabled()
                                  throws JCGLException,
                                         JCGLExceptionNoStencilBuffer

      Returns:
        `true` iff stencil testing is enabled
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionNoStencilBuffer` - If no stencil buffer is available

    - #### stencilBufferMask

          void stencilBufferMask(JCGLFaceSelection faces,
                                 int mask)
                          throws JCGLException,
                                 JCGLExceptionNoStencilBuffer

      Control the writing of bits in the stencil buffer for the faces given by `faces`. The least significant bits in the value `mask` are used to control writing of bits; Where a 1 appears in the mask, it's possible to write to the corresponding bit in the stencil buffer. Where a 0 appears, the corresponding bit is write-protected. Initially, all bits are enabled for writing.
      Parameters:
        `mask` - The stencil mask
        `faces` - The face selection
      Throws:
        `JCGLException` - Iff an internal OpenGL error occurs
        `JCGLExceptionNoStencilBuffer` - If no stencil buffer is available

    - #### stencilBufferOperation

          void stencilBufferOperation(JCGLFaceSelection faces,
                                      JCGLStencilOperation stencil_fail,
                                      JCGLStencilOperation depth_fail,
                                      JCGLStencilOperation pass)
                               throws JCGLException

      Configure the operations to be performed on the stencil buffer for the faces given by `faces`.
      Parameters:
        `faces` - The face selection
        `stencil_fail` - The operation to perform when the stencil test fails
        `depth_fail` - The operation to perform when the stencil test passes but the depth test fails
        `pass` - The operation to perform when the stencil and depth test (if any) passes
      Throws:
        `JCGLException` - Iff an internal OpenGL error occurs

    - #### stencilBufferGetMaskFrontFaces

          int stencilBufferGetMaskFrontFaces()

      Returns:
        The mask value specified for front faces

    - #### stencilBufferGetMaskBackFaces

          int stencilBufferGetMaskBackFaces()

      Returns:
        The mask value specified for back faces

    - #### stencilBufferGetOperationStencilFailBack

          JCGLStencilOperation stencilBufferGetOperationStencilFailBack()

      Returns:
        The operation specified for back faces that fail the stencil test

    - #### stencilBufferGetOperationDepthFailBack

          JCGLStencilOperation stencilBufferGetOperationDepthFailBack()

      Returns:
        The operation specified for back faces that fail the depth test

    - #### stencilBufferGetOperationPassBack

          JCGLStencilOperation stencilBufferGetOperationPassBack()

      Returns:
        The operation specified for back faces that pass all tests

    - #### stencilBufferGetOperationStencilFailFront

          JCGLStencilOperation stencilBufferGetOperationStencilFailFront()

      Returns:
        The operation specified for front faces that fail the stencil test

    - #### stencilBufferGetOperationDepthFailFront

          JCGLStencilOperation stencilBufferGetOperationDepthFailFront()

      Returns:
        The operation specified for front faces that fail the depth test

    - #### stencilBufferGetOperationPassFront

          JCGLStencilOperation stencilBufferGetOperationPassFront()

      Returns:
        The operation specified for front faces that pass all tests

    - #### stencilBufferGetFunctionFront

          JCGLStencilFunction stencilBufferGetFunctionFront()

      Returns:
        The stencil function for front faces

    - #### stencilBufferGetFunctionBack

          JCGLStencilFunction stencilBufferGetFunctionBack()

      Returns:
        The stencil function for back faces

    - #### stencilBufferGetFunctionReferenceFront

          int stencilBufferGetFunctionReferenceFront()

      Returns:
        The stencil function reference value for front faces

    - #### stencilBufferGetFunctionMaskFront

          int stencilBufferGetFunctionMaskFront()

      Returns:
        The stencil function mask value for front faces

    - #### stencilBufferGetFunctionReferenceBack

          int stencilBufferGetFunctionReferenceBack()

      Returns:
        The stencil function reference value for back faces

    - #### stencilBufferGetFunctionMaskBack

          int stencilBufferGetFunctionMaskBack()

      Returns:
        The stencil function mask value for back faces

Copyright © 2016 <code@io7m.com> http://io7m.com