Class DepthTestingManager

java.lang.Object
rosequartz.gfx.DepthTestingManager

public final class DepthTestingManager extends Object
Class for managing depth testing.
  • Constructor Details

  • Method Details

    • get

      public static DepthTestingManager get()
      Gets the depth-testing manager.
      Returns:
      DepthTestingManager-object
      See Also:
      DepthTestingManager
    • setEnabled

      public DepthTestingManager setEnabled(boolean enabled) throws NotOnGraphicsThreadException
      Enables / disables depth testing. Depth testing is disabled by default and - if enabled - checks if the currently drawn pixel is in front of old the pixel at that position before setting it. This makes sure that (for example) the back side of a cube is not drawn in front of the front side.
      Parameters:
      enabled - depth testing enabled
      Returns:
      this
      Throws:
      NotOnGraphicsThreadException
    • isEnabled

      public boolean isEnabled()
      Gets if depth testing is enabled.
      Returns:
      depth testing enabled
    • setFunction

      Sets the function used for depth testing. The default is TestingFunction.LESS.

      TestingFunction.NEVER will never draw,
      TestingFunction.LESS will draw if the stored depth is less than the drawn depth,
      TestingFunction.GREATER will draw if the stored depth is greater than the drawn depth,
      TestingFunction.EQUAL will draw if the stored depth is equal to the drawn depth,
      TestingFunction.ALWAYS will always draw,
      TestingFunction.LESS_EQUAL will draw if the stored depth is less than or equal to the drawn depth,
      TestingFunction.GREATER_EQUAL will draw if the stored depth is greater than or equal to the drawn depth,
      TestingFunction.NOT_EQUAL will draw if the stored depth is not equal to the drawn depth.

      Parameters:
      function - comparison used for testing
      Returns:
      this
      Throws:
      NotOnGraphicsThreadException
    • getFunction

      Gets the current function used for depth testing.
      Returns:
      depth testing function