|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rugl.gl.State
public class State
Represents a rendering state
| Field Summary | |
|---|---|
AlphaTest |
alphaTest
Alpha test function |
Blend |
blend
Blend function |
DepthTest |
depthTest
Depth test |
PolygonMode |
polyMode
Polygon rasterisation mode |
PolygonOffset |
polyOffset
Polygon offset |
TextureState |
texture
Texture state |
| Constructor Summary | |
|---|---|
State(boolean texture,
boolean alphaTest,
boolean blend,
boolean depthTest,
boolean polyMode,
boolean polyOffset)
Constructs a state that controls some facets of OpenGL state. |
|
| Method Summary | |
|---|---|
void |
apply()
Applies this rendering state to OpenGL |
State |
cloneInstance()
Gets a clone of this state. |
int |
compareTo(State o)
|
static void |
compile(State... states)
Compiles a set of states so that compiledState.compareTo(
otherCompiledState ) is fast: a simple int comparison
rather than a traversal of the entire state tree. |
boolean |
equals(java.lang.Object o)
|
int |
getCompilationBatch()
Comparisons based on getCompiledIndex() between states
with different getCompilationBatch() values are invalid |
int |
getCompiledIndex()
Gets the index that this state achieved in its compilation batch. |
void |
set(State state)
Copies the values of the supplied State to this one. |
void |
setShader(ShaderProgram shader)
Sets the shader program |
static void |
stateReset()
The State class mirrors the OpenGL state as much as
possible, so don't change it outside of State, and call
this when the OpenGL State is refreshed e.g.: when the display
has been (re)created |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final TextureState texture
public final AlphaTest alphaTest
public final Blend blend
public final DepthTest depthTest
public final PolygonMode polyMode
public final PolygonOffset polyOffset
| Constructor Detail |
|---|
public State(boolean texture,
boolean alphaTest,
boolean blend,
boolean depthTest,
boolean polyMode,
boolean polyOffset)
texture - alphaTest - blend - depthTest - polyMode - polyOffset - | Method Detail |
|---|
public static void stateReset()
State class mirrors the OpenGL state as much as
possible, so don't change it outside of State, and call
this when the OpenGL State is refreshed e.g.: when the display
has been (re)created
public static void compile(State... states)
compiledState.compareTo(
otherCompiledState ) is fast: a simple int comparison
rather than a traversal of the entire state tree. On the other
hand, changes to a compiled state will cause assertion errors as
you've probably messed up the order.
states - public void setShader(ShaderProgram shader)
shader - the new shader, or null for
fixed-functionpublic State cloneInstance()
public void set(State state)
State to this one.
Note that compilation status is not copied - there is very
little point in having two separate but identical instances of a
compiled state
state - the state to copypublic void apply()
public int getCompilationBatch()
getCompiledIndex() between states
with different getCompilationBatch() values are invalid
State, or -1 if this state has not been compiledpublic int getCompiledIndex()
public int compareTo(State o)
compareTo in interface java.lang.Comparable<State>public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||