com.threerings.opengl.renderer.state
Class PolygonState

java.lang.Object
  extended by com.threerings.opengl.renderer.state.RenderState
      extended by com.threerings.opengl.renderer.state.PolygonState

public class PolygonState
extends RenderState

Contains the polygon state.


Field Summary
static PolygonState DEFAULT
          The default state.
static PolygonState WIREFRAME
          Simple wireframe state.
 
Fields inherited from class com.threerings.opengl.renderer.state.RenderState
ALPHA_STATE, ARRAY_STATE, COLOR_MASK_STATE, COLOR_STATE, CULL_STATE, DEPTH_STATE, FOG_STATE, LIGHT_STATE, LINE_STATE, MATERIAL_STATE, POINT_STATE, POLYGON_STATE, SHADER_STATE, STATE_COUNT, STENCIL_STATE, TEXTURE_STATE, TRANSFORM_STATE
 
Constructor Summary
PolygonState(int frontPolygonMode, int backPolygonMode, float polygonOffsetFactor, float polygonOffsetUnits)
          Creates a new polygon state.
 
Method Summary
 void apply(Renderer renderer)
          Applies this state.
 boolean equals(Object other)
           
 int getBackPolygonMode()
          Returns the back-facing polygon mode.
 int getFrontPolygonMode()
          Returns the front-facing polygon mode.
static PolygonState getInstance(int frontPolygonMode, int backPolygonMode, float polygonOffsetFactor, float polygonOffsetUnits)
          If there is a shared instance with the supplied parameters, returns a reference to it; otherwise, returns a new state with the parameters.
static PolygonState getInstance(PolygonState state)
          If there is a shared equivalent to the specified state, this method will return the shared state; otherwise, it will simply return the parameter.
 float getPolygonOffsetFactor()
          Returns the proportional polygon offset.
 float getPolygonOffsetUnits()
          Returns the constant polygon offset.
 int getType()
          Returns the type of this state.
 
Methods inherited from class com.threerings.opengl.renderer.state.RenderState
copy, createDefaultSet, createEmptySet, getDefaults, isDirty, setDirty
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final PolygonState DEFAULT
The default state.


WIREFRAME

public static final PolygonState WIREFRAME
Simple wireframe state.

Constructor Detail

PolygonState

public PolygonState(int frontPolygonMode,
                    int backPolygonMode,
                    float polygonOffsetFactor,
                    float polygonOffsetUnits)
Creates a new polygon state.

Method Detail

getInstance

public static PolygonState getInstance(int frontPolygonMode,
                                       int backPolygonMode,
                                       float polygonOffsetFactor,
                                       float polygonOffsetUnits)
If there is a shared instance with the supplied parameters, returns a reference to it; otherwise, returns a new state with the parameters.


getInstance

public static PolygonState getInstance(PolygonState state)
If there is a shared equivalent to the specified state, this method will return the shared state; otherwise, it will simply return the parameter.


getFrontPolygonMode

public int getFrontPolygonMode()
Returns the front-facing polygon mode.


getBackPolygonMode

public int getBackPolygonMode()
Returns the back-facing polygon mode.


getPolygonOffsetFactor

public float getPolygonOffsetFactor()
Returns the proportional polygon offset.


getPolygonOffsetUnits

public float getPolygonOffsetUnits()
Returns the constant polygon offset.


getType

public int getType()
Description copied from class: RenderState
Returns the type of this state.

Specified by:
getType in class RenderState

apply

public void apply(Renderer renderer)
Description copied from class: RenderState
Applies this state.

Specified by:
apply in class RenderState

equals

public boolean equals(Object other)
Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.