Class OGLClearNode
java.lang.Object
com.blackrook.gloop.opengl.node.OGLClearNode
- All Implemented Interfaces:
OGLNode<OGL11Graphics>
Node that clears one or more buffers.
- Author:
- Matthew Tropiano
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new OGLClearNode.OGLClearNode(boolean color, boolean depth, boolean accum, boolean stencil) Creates a new OGLClearNode. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets if this clears the accumulation buffer.booleanGets if this clears the color buffer.booleanGets if this clears the depth buffer.booleanGets if this clears the stencil buffer.floatlongReturns the length of time it took to render this node, in nanoseconds.voidDisplays this node.voidsetClearAccumulationBuffer(boolean clearAccumulationBuffer) Sets if this clears the accumulation buffer.voidsetClearColor(float red, float green, float blue, float alpha) Sets the color used with which to clear the color buffer.voidsetClearColorBuffer(boolean clearColorBuffer) Sets if this clears the color buffer.voidsetClearDepthBuffer(boolean clearDepthBuffer) Sets if this clears the depth buffer.voidsetClearStencilBuffer(boolean clearStencilBuffer) Sets if this clears the stencil buffer.voidsetDepthValue(float depthValue) Sets the depth value used with which to clear the depth buffer.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface OGLNode
getPolygonsRendered, onFramebufferResize
-
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
Description copied from interface:OGLNodeDisplays this node. The rendering thread for the target window enters this method, so it is safe to call allOGLGraphicsfunctions here.- Specified by:
onDisplayin interfaceOGLNode<OGL11Graphics>- Parameters:
gl- the graphics object used for issuing commands to OpenGL.
-
getRenderTimeNanos
public long getRenderTimeNanos()Description copied from interface:OGLNodeReturns 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 hadOGLNode.onDisplay(OGLGraphics)called on it.- Specified by:
getRenderTimeNanosin interfaceOGLNode<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.
-