Package rosequartz.gfx
Class GraphicsState
java.lang.Object
rosequartz.gfx.GraphicsState
Represents a State in the Graphics Pipeline.
This class can be used to get a copy of the current state of the graphics pipeline,
with the current render target, the selected shader program, depth testing settings
and more.
The state can then be changed and restored.
This makes it easy for making APIs where the state needs to be exactly like before,
or managing the state in general.
This class stores:
- selected depth testing function - depth testing enabled / disabled - targeted render target - selected shader program
-
Method Summary
Modifier and TypeMethodDescriptionstatic GraphicsStateget()Gets the representation of the current state of the graphics pipeline.Gets the depth testing function used in this state of the graphics pipeline.booleanGets if depth testing is enabled in this state of the graphics pipeline.Gets the render target in this state of the graphics pipeline.Gets the shader program used in this state of the graphics pipeline.voidrestore()Replaces the current graphics state with this one.toString()
-
Method Details
-
get
Gets the representation of the current state of the graphics pipeline.- Returns:
- current graphics state
-
getDepthTesting
public boolean getDepthTesting()Gets if depth testing is enabled in this state of the graphics pipeline.- Returns:
- depth testing function
-
getDepthFunction
Gets the depth testing function used in this state of the graphics pipeline.- Returns:
- depth testing function
-
getRenderTarget
Gets the render target in this state of the graphics pipeline.- Returns:
- render target
-
getShaderProgram
Gets the shader program used in this state of the graphics pipeline.- Returns:
- shader program
-
restore
Replaces the current graphics state with this one.- Throws:
NotOnGraphicsThreadException
-
toString
-