Class OGLClearNode

java.lang.Object
com.blackrook.gloop.opengl.node.OGLClearNode
All Implemented Interfaces:
OGLNode<OGL11Graphics>

public class OGLClearNode extends Object implements OGLNode<OGL11Graphics>
Node that clears one or more buffers.
Author:
Matthew Tropiano
  • Constructor Details

    • OGLClearNode

      public OGLClearNode()
      Creates a new OGLClearNode.
    • OGLClearNode

      public OGLClearNode(boolean color, boolean depth, boolean accum, boolean stencil)
      Creates a new OGLClearNode.
      Parameters:
      color - clear the color buffer?
      depth - clear the depth buffer?
      accum - clear the accum buffer?
      stencil - clear the stencil buffer?
  • Method Details

    • onDisplay

      public void onDisplay(OGL11Graphics gl)
      Description copied from interface: OGLNode
      Displays this node. The rendering thread for the target window enters this method, so it is safe to call all OGLGraphics functions here.
      Specified by:
      onDisplay in interface OGLNode<OGL11Graphics>
      Parameters:
      gl - the graphics object used for issuing commands to OpenGL.
    • getRenderTimeNanos

      public long getRenderTimeNanos()
      Description copied from interface: OGLNode
      Returns the length of time it took to render this node, in nanoseconds. Results of this call should not be considered accurate until the node has had OGLNode.onDisplay(OGLGraphics) called on it.
      Specified by:
      getRenderTimeNanos in interface OGLNode<OGL11Graphics>
      Returns:
      the length of time it took to render this node, in nanoseconds.
    • setClearColor

      public void setClearColor(float red, float green, float blue, float alpha)
      Sets the color used with which to clear the color buffer.
      Parameters:
      red - the red component of the color to use (0 to 1).
      green - the green component of the color to use (0 to 1).
      blue - the blue component of the color to use (0 to 1).
      alpha - the alpha component of the color to use (0 to 1).
    • getDepthValue

      public float getDepthValue()
      Returns:
      the depth value used with which to clear the depth buffer.
    • setDepthValue

      public void setDepthValue(float depthValue)
      Sets the depth value used with which to clear the depth buffer.
      Parameters:
      depthValue - the depth value.
    • clearsColorBuffer

      public boolean clearsColorBuffer()
      Gets if this clears the color buffer.
      Returns:
      true if so, false if not.
    • setClearColorBuffer

      public void setClearColorBuffer(boolean clearColorBuffer)
      Sets if this clears the color buffer.
      Parameters:
      clearColorBuffer - true if so, false if not.
    • clearsDepthBuffer

      public boolean clearsDepthBuffer()
      Gets if this clears the depth buffer.
      Returns:
      true if so, false if not.
    • setClearDepthBuffer

      public void setClearDepthBuffer(boolean clearDepthBuffer)
      Sets if this clears the depth buffer.
      Parameters:
      clearDepthBuffer - true if so, false if not.
    • clearsAccumulationBuffer

      public boolean clearsAccumulationBuffer()
      Gets if this clears the accumulation buffer.
      Returns:
      true if so, false if not.
    • setClearAccumulationBuffer

      public void setClearAccumulationBuffer(boolean clearAccumulationBuffer)
      Sets if this clears the accumulation buffer.
      Parameters:
      clearAccumulationBuffer - true if so, false if not.
    • clearsStencilBuffer

      public boolean clearsStencilBuffer()
      Gets if this clears the stencil buffer.
      Returns:
      true if so, false if not.
    • setClearStencilBuffer

      public void setClearStencilBuffer(boolean clearStencilBuffer)
      Sets if this clears the stencil buffer.
      Parameters:
      clearStencilBuffer - true if so, false if not.