public class RenderState extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RenderState.ProgramLocal
|
Modifier and Type | Field and Description |
---|---|
static int |
BITHINT_BLENDING_ENABLED
Bitfield hint,
if set
stating enabled GL.GL_BLEND , otherwise disabled. |
static int |
BITHINT_GLOBAL_DEPTH_TEST_ENABLED
Bitfield hint,
if set
stating globally enabled GL.GL_DEPTH_TEST , otherwise disabled. |
Modifier and Type | Method and Description |
---|---|
RenderState |
attachTo(GL2ES2 gl) |
void |
clearHintMask(int mask) |
static RenderState |
createRenderState(Vertex.Factory<? extends Vertex> pointFactory) |
static RenderState |
createRenderState(Vertex.Factory<? extends Vertex> pointFactory,
PMVMatrix pmvMatrix) |
void |
destroy(GL2ES2 gl) |
boolean |
detachFrom(GL2ES2 gl) |
float[] |
getColorStatic(float[] rgbaColor) |
PMVMatrix |
getMatrix() |
static RenderState |
getRenderState(GL2ES2 gl) |
ShaderProgram |
getShaderProgram() |
Vertex.Factory<? extends Vertex> |
getVertexFactory() |
float |
getWeight() |
int |
id() |
boolean |
isHintMaskSet(int mask) |
boolean |
isShaderProgramInUse() |
static boolean |
isWeightValid(float v) |
void |
setColorStatic(float r,
float g,
float b,
float a) |
void |
setHintMask(int mask) |
boolean |
setShaderProgram(GL2ES2 gl,
ShaderProgram spNext)
Set a
ShaderProgram and enable it. |
void |
setWeight(float v) |
String |
toString() |
boolean |
updateAttributeLoc(GL2ES2 gl,
boolean updateLocation,
GLArrayDataServer data,
boolean throwOnError) |
boolean |
updateUniformDataLoc(GL2ES2 gl,
boolean updateLocation,
boolean updateData,
GLUniformData data,
boolean throwOnError) |
boolean |
updateUniformLoc(GL2ES2 gl,
boolean updateLocation,
GLUniformData data,
boolean throwOnError) |
public static final int BITHINT_BLENDING_ENABLED
if set
stating enabled GL.GL_BLEND
, otherwise disabled.
Shall be set via setHintMask(int)
and cleared via clearHintMask(int)
.
If set, GLRegion's draw-method
will set the proper blend-function
and the clear-color to transparent-black in case of multipass
FBO rendering.
Shall be set by custom code, e.g. via RegionRenderer
's
enable and disable RegionRenderer.GLCallback
as done in
RegionRenderer.defaultBlendEnable
and RegionRenderer.defaultBlendDisable
.
public static final int BITHINT_GLOBAL_DEPTH_TEST_ENABLED
if set
stating globally enabled GL.GL_DEPTH_TEST
, otherwise disabled.
Shall be set via setHintMask(int)
and cleared via clearHintMask(int)
.
GLRegion's draw-method
may toggle depth test, and reset it's state according to this hint.
Shall be set by custom code, e.g. after RenderState
or RegionRenderer
construction.
public static RenderState createRenderState(Vertex.Factory<? extends Vertex> pointFactory)
public static RenderState createRenderState(Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix)
public static final RenderState getRenderState(GL2ES2 gl)
public final int id()
public final ShaderProgram getShaderProgram()
public final boolean isShaderProgramInUse()
public final boolean setShaderProgram(GL2ES2 gl, ShaderProgram spNext)
ShaderProgram
and enable it. If the given ShaderProgram
is new,
method returns true, otherwise false.gl
- spNext
- public final Vertex.Factory<? extends Vertex> getVertexFactory()
public final PMVMatrix getMatrix()
public static boolean isWeightValid(float v)
public final float getWeight()
public final void setWeight(float v)
public final float[] getColorStatic(float[] rgbaColor)
public final void setColorStatic(float r, float g, float b, float a)
public final boolean updateUniformLoc(GL2ES2 gl, boolean updateLocation, GLUniformData data, boolean throwOnError)
gl
- updateLocation
- data
- throwOnError
- TODOpublic final boolean updateUniformDataLoc(GL2ES2 gl, boolean updateLocation, boolean updateData, GLUniformData data, boolean throwOnError)
gl
- updateLocation
- updateData
- TODOdata
- throwOnError
- TODOpublic final boolean updateAttributeLoc(GL2ES2 gl, boolean updateLocation, GLArrayDataServer data, boolean throwOnError)
gl
- data
- throwOnError
- TODOpublic final boolean isHintMaskSet(int mask)
public final void setHintMask(int mask)
public final void clearHintMask(int mask)
public void destroy(GL2ES2 gl)
public final RenderState attachTo(GL2ES2 gl)
public final boolean detachFrom(GL2ES2 gl)
Copyright 2010 JogAmp Community.