Class RenderState

java.lang.Object
com.codename1.gpu.RenderState

public final class RenderState extends Object
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).
  • Constructor Details

    • RenderState

      public RenderState()
  • Method Details

    • opaque

      public static RenderState opaque()
      Returns a render state suitable for opaque geometry.
    • transparent

      public static RenderState 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

      public RenderState setDepthTest(boolean depthTest)

      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

      public RenderState setDepthWrite(boolean depthWrite)

      Enables or disables writing to the depth buffer.

      Parameters
      • depthWrite: true to write depth values
      Returns

      this state for chaining

    • getBlendMode

      public RenderState.BlendMode getBlendMode()
      Returns the configured blend mode.
    • setBlendMode

      public RenderState setBlendMode(RenderState.BlendMode blendMode)

      Sets the blend mode.

      Parameters
      • blendMode: the blend mode
      Returns

      this state for chaining

    • getCullMode

      public RenderState.CullMode getCullMode()
      Returns the configured cull mode.
    • setCullMode

      public RenderState setCullMode(RenderState.CullMode cullMode)

      Sets the face culling mode.

      Parameters
      • cullMode: the cull mode
      Returns

      this state for chaining