Package com.jogamp.graph.curve.opengl
Class RenderState
- java.lang.Object
-
- com.jogamp.graph.curve.opengl.RenderState
-
public class RenderState extends Object
The RenderState is owned byRegionRenderer
. It holds rendering state data likePMVMatrix
, viewport, but also the currentstatic color
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RenderState.ProgramLocal
-
Field Summary
Fields Modifier and Type Field Description static int
BITHINT_BLENDING_ENABLED
Bitfield hint,if set
stating enabledGL.GL_BLEND
, otherwise disabled.static int
BITHINT_GLOBAL_DEPTH_TEST_ENABLED
Bitfield hint,if set
stating globally enabledGL.GL_DEPTH_TEST
, otherwise disabled.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RenderState
attachTo(GL2ES2 gl)
void
clearHintMask(int mask)
boolean
detachFrom(GL2ES2 gl)
Vec4f
getColorStatic(Vec4f rgbaColor)
PMVMatrix
getMatrix()
static RenderState
getRenderState(GL2ES2 gl)
ShaderProgram
getShaderProgram()
Return the currentShaderProgram
float
getWeight()
int
id()
boolean
isHintMaskSet(int mask)
boolean
isShaderProgramInUse()
Return whether the currentShaderProgram
isin use
.static boolean
isWeightValid(float v)
void
setColorStatic(float r, float g, float b, float a)
void
setColorStatic(Vec4f rgbaColor)
void
setHintMask(int mask)
boolean
setShaderProgram(GL2ES2 gl, ShaderProgram spNext)
Sets the currentShaderProgram
and enables it.void
setWeight(float v)
String
toString()
boolean
updateAttributeLoc(GL2ES2 gl, boolean updateLocation, GLArrayDataWrapper 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)
-
-
-
Field Detail
-
BITHINT_BLENDING_ENABLED
public static final int BITHINT_BLENDING_ENABLED
Bitfield hint,if set
stating enabledGL.GL_BLEND
, otherwise disabled.Shall be set via
setHintMask(int)
and cleared viaclearHintMask(int)
.If set,
GLRegion's draw-method
will set the properblend-function
and the clear-color to transparent-black in case ofmultipass
FBO rendering.Shall be set by custom code, e.g. via
RegionRenderer
's enable and disableRegionRenderer.GLCallback
as done inRegionRenderer.defaultBlendEnable
andRegionRenderer.defaultBlendDisable
.- See Also:
- Constant Field Values
-
BITHINT_GLOBAL_DEPTH_TEST_ENABLED
public static final int BITHINT_GLOBAL_DEPTH_TEST_ENABLED
Bitfield hint,if set
stating globally enabledGL.GL_DEPTH_TEST
, otherwise disabled.Shall be set via
setHintMask(int)
and cleared viaclearHintMask(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
orRegionRenderer
construction.- See Also:
- Constant Field Values
-
-
Method Detail
-
getRenderState
public static final RenderState getRenderState(GL2ES2 gl)
-
id
public final int id()
-
getShaderProgram
public final ShaderProgram getShaderProgram()
Return the currentShaderProgram
-
isShaderProgramInUse
public final boolean isShaderProgramInUse()
Return whether the currentShaderProgram
isin use
.
-
setShaderProgram
public final boolean setShaderProgram(GL2ES2 gl, ShaderProgram spNext)
Sets the currentShaderProgram
and enables it. If the givenShaderProgram
is notthe current
, method returns true, otherwise false.- Parameters:
gl
-spNext
- the next currentShaderProgram
to be set and enabled- Returns:
- true if a new shader program is being used and hence external uniform-data and -location, as well as the attribute-location must be updated, otherwise false.
-
getMatrix
public final PMVMatrix getMatrix()
-
isWeightValid
public static boolean isWeightValid(float v)
-
getWeight
public final float getWeight()
-
setWeight
public final void setWeight(float v)
-
setColorStatic
public final void setColorStatic(Vec4f rgbaColor)
-
setColorStatic
public final void setColorStatic(float r, float g, float b, float a)
-
updateUniformLoc
public final boolean updateUniformLoc(GL2ES2 gl, boolean updateLocation, GLUniformData data, boolean throwOnError)
- Parameters:
gl
-updateLocation
-data
-throwOnError
- TODO- Returns:
- true if no error occured, i.e. all locations found, otherwise false.
-
updateUniformDataLoc
public final boolean updateUniformDataLoc(GL2ES2 gl, boolean updateLocation, boolean updateData, GLUniformData data, boolean throwOnError)
- Parameters:
gl
-updateLocation
-updateData
- TODOdata
-throwOnError
- TODO- Returns:
- true if no error occured, i.e. all locations found, otherwise false.
-
updateAttributeLoc
public final boolean updateAttributeLoc(GL2ES2 gl, boolean updateLocation, GLArrayDataWrapper data, boolean throwOnError)
- Parameters:
gl
-data
-throwOnError
- TODO- Returns:
- true if no error occured, i.e. all locations found, otherwise false.
-
isHintMaskSet
public final boolean isHintMaskSet(int mask)
-
setHintMask
public final void setHintMask(int mask)
-
clearHintMask
public final void clearHintMask(int mask)
-
attachTo
public final RenderState attachTo(GL2ES2 gl)
-
detachFrom
public final boolean detachFrom(GL2ES2 gl)
-
-