Class RenderState
java.lang.Object
com.codename1.gpu.RenderState
Fixed function pipeline state attached to a
Material: depth testing, alpha
blending and face culling. Sensible defaults are provided for opaque 3D
geometry (depth test and write on, no blending, back faces culled).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe alpha blending mode applied when a fragment is written.static enumWhich triangle faces are discarded before rasterization. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the configured blend mode.Returns the configured cull mode.booleanReturns true if depth testing is enabled.booleanReturns true if writing to the depth buffer is enabled.static RenderStateopaque()Returns a render state suitable for opaque geometry.setBlendMode(RenderState.BlendMode blendMode) Sets the blend mode.setCullMode(RenderState.CullMode cullMode) Sets the face culling mode.setDepthTest(boolean depthTest) Enables or disables depth testing.setDepthWrite(boolean depthWrite) Enables or disables writing to the depth buffer.static RenderStateReturns a render state suitable for alpha blended, non depth writing transparent geometry.
-
Constructor Details
-
RenderState
public RenderState()
-
-
Method Details
-
opaque
Returns a render state suitable for opaque geometry. -
transparent
Returns a render state suitable for alpha blended, non depth writing transparent geometry. -
isDepthTest
public boolean isDepthTest()Returns true if depth testing is enabled. -
setDepthTest
Enables or disables depth testing.
Parameters
depthTest: true to enable depth testing
Returns
this state for chaining
-
isDepthWrite
public boolean isDepthWrite()Returns true if writing to the depth buffer is enabled. -
setDepthWrite
Enables or disables writing to the depth buffer.
Parameters
depthWrite: true to write depth values
Returns
this state for chaining
-
getBlendMode
Returns the configured blend mode. -
setBlendMode
Sets the blend mode.
Parameters
blendMode: the blend mode
Returns
this state for chaining
-
getCullMode
Returns the configured cull mode. -
setCullMode
Sets the face culling mode.
Parameters
cullMode: the cull mode
Returns
this state for chaining
-