Top Inners Fields Constructors Methods
com.jogamp.graph.curve.opengl

public Class RenderState

extends Object
Class Inheritance
Imports
java.nio.FloatBuffer, com.jogamp.opengl.GL, .GL2ES2, .GLException, .GLUniformData, jogamp.common.os.PlatformPropsImpl, jogamp.graph.curve.opengl.shader.UniformNames, com.jogamp.common.os.Platform, com.jogamp.graph.curve.Region, com.jogamp.graph.geom.Vertex, com.jogamp.opengl.util.GLArrayDataServer, .PMVMatrix, com.jogamp.opengl.util.glsl.ShaderProgram

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
BITHINT_BLENDING_ENABLED

Bitfield hint, if set stating enabled GL#GL_BLEND, otherwise disabled.

public static final int
BITHINT_GLOBAL_DEPTH_TEST_ENABLED

Bitfield hint, if set stating globally enabled GL#GL_DEPTH_TEST, otherwise disabled.

private final float[]
private final FloatBuffer
private int
private final int
private static int
private final PMVMatrix
private ShaderProgram
private static final String
private final Vertex.Factory<? extends Vertex>
private final float[]
private final FloatBuffer

Constructor Summary

AccessConstructor and Description
protected
RenderState(final Vertex.Factory<? extends Vertex> vertexFactory, final PMVMatrix pmvMatrix)

Method Summary

Modifier and TypeMethod and Description
public final RenderState
attachTo(final GL2ES2 gl)

public final void
clearHintMask(final int mask)

public static RenderState
createRenderState(final Vertex.Factory<? extends Vertex> pointFactory)

public static RenderState
createRenderState(final Vertex.Factory<? extends Vertex> pointFactory, final PMVMatrix pmvMatrix)

public void
destroy(final GL2ES2 gl)

public final boolean
detachFrom(final GL2ES2 gl)

public final float[]
getColorStatic(final float[] rgbaColor)

public final PMVMatrix
private static synchronized int
public static final RenderState
public final ShaderProgram
public final Vertex.Factory<? extends Vertex>
public final float
public final int
id()

public final boolean
isHintMaskSet(final int mask)

public final boolean
public static boolean
isWeightValid(final float v)

public final void
setColorStatic(final float r, final float g, final float b, final float a)

public final void
setHintMask(final int mask)

public final boolean

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.
setShaderProgram
(final GL2ES2 gl, final ShaderProgram spNext)

Set a ShaderProgram and enable it.

public final void
setWeight(final float v)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public final boolean

Returns:

true if no error occured, i.e. all locations found, otherwise false.
updateAttributeLoc
(final GL2ES2 gl, final boolean updateLocation, final GLArrayDataServer data, final boolean
TODO
throwOnError
)

public final boolean

Returns:

true if no error occured, i.e. all locations found, otherwise false.
updateUniformDataLoc
(final GL2ES2 gl, boolean updateLocation, boolean
TODO
updateData
,
final GLUniformData data, final boolean
TODO
throwOnError
)

public final boolean

Returns:

true if no error occured, i.e. all locations found, otherwise false.
updateUniformLoc
(final GL2ES2 gl, final boolean updateLocation, final GLUniformData data, final boolean
TODO
throwOnError
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

BITHINT_BLENDING_ENABLEDback to summary
public static final int BITHINT_BLENDING_ENABLED

Bitfield hint, 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.

BITHINT_GLOBAL_DEPTH_TEST_ENABLEDback to summary
public static final int BITHINT_GLOBAL_DEPTH_TEST_ENABLED

Bitfield hint, 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.

colorStaticback to summary
private final float[] colorStatic
colorStaticBufferback to summary
private final FloatBuffer colorStaticBuffer
hintBitfieldback to summary
private int hintBitfield
idback to summary
private final int id
nextIDback to summary
private static int nextID
pmvMatrixback to summary
private final PMVMatrix pmvMatrix
spback to summary
private ShaderProgram sp
thisKeyback to summary
private static final String thisKey
vertexFactoryback to summary
private final Vertex.Factory<? extends Vertex> vertexFactory
weightback to summary
private final float[] weight
weightBufferback to summary
private final FloatBuffer weightBuffer

Constructor Detail

RenderStateback to summary
protected RenderState(final Vertex.Factory<? extends Vertex> vertexFactory, final PMVMatrix pmvMatrix)

Method Detail

attachToback to summary
public final RenderState attachTo(final GL2ES2 gl)
clearHintMaskback to summary
public final void clearHintMask(final int mask)
createRenderStateback to summary
public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory)
createRenderStateback to summary
public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory, final PMVMatrix pmvMatrix)
destroyback to summary
public void destroy(final GL2ES2 gl)
detachFromback to summary
public final boolean detachFrom(final GL2ES2 gl)
getColorStaticback to summary
public final float[] getColorStatic(final float[] rgbaColor)
getMatrixback to summary
public final PMVMatrix getMatrix()
getNextIDback to summary
private static synchronized int getNextID()
getRenderStateback to summary
public static final RenderState getRenderState(final GL2ES2 gl)
getShaderProgramback to summary
public final ShaderProgram getShaderProgram()
getVertexFactoryback to summary
public final Vertex.Factory<? extends Vertex> getVertexFactory()
getWeightback to summary
public final float getWeight()
idback to summary
public final int id()
isHintMaskSetback to summary
public final boolean isHintMaskSet(final int mask)
isShaderProgramInUseback to summary
public final boolean isShaderProgramInUse()
isWeightValidback to summary
public static boolean isWeightValid(final float v)
setColorStaticback to summary
public final void setColorStatic(final float r, final float g, final float b, final float a)
setHintMaskback to summary
public final void setHintMask(final int mask)
setShaderProgramback to summary
public final boolean setShaderProgram(final GL2ES2 gl, final ShaderProgram spNext)

Set a ShaderProgram and enable it. If the given ShaderProgram is new, method returns true, otherwise false.

Returns:boolean

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.

setWeightback to summary
public final void setWeight(final float v)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
updateAttributeLocback to summary
public final boolean updateAttributeLoc(final GL2ES2 gl, final boolean updateLocation, final GLArrayDataServer data, final boolean throwOnError)
Parameters
throwOnError:boolean

TODO

Returns:boolean

true if no error occured, i.e. all locations found, otherwise false.

updateUniformDataLocback to summary
public final boolean updateUniformDataLoc(final GL2ES2 gl, boolean updateLocation, boolean updateData, final GLUniformData data, final boolean throwOnError)
Parameters
updateData:boolean

TODO

throwOnError:boolean

TODO

Returns:boolean

true if no error occured, i.e. all locations found, otherwise false.

updateUniformLocback to summary
public final boolean updateUniformLoc(final GL2ES2 gl, final boolean updateLocation, final GLUniformData data, final boolean throwOnError)
Parameters
throwOnError:boolean

TODO

Returns:boolean

true if no error occured, i.e. all locations found, otherwise false.

com.jogamp.graph.curve.opengl back to summary

public Class RenderState.ProgramLocal

extends Object
Class Inheritance

Representation of RenderState data for one ShaderProgram as GLUniformData.

FIXME: Utilize 'ARB_Uniform_Buffer_Object' where available!

Field Summary

Modifier and TypeField and Description
public final GLUniformData
public final GLUniformData
public final GLUniformData
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final int
public StringBuilder
toString(StringBuilder sb, final boolean alsoUnlocated)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public final boolean

Returns:

true if no error occurred, i.e. all locations found, otherwise false.
update
(final GL2ES2 gl, final RenderState rs, final boolean updateLocation, final int renderModes, final boolean pass1, final boolean
TODO
throwOnError
)

Since RenderState data is being used in multiple ShaderPrograms the data must always be written.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

gcu_ColorStaticback to summary
public final GLUniformData gcu_ColorStatic
gcu_PMVMatrix01back to summary
public final GLUniformData gcu_PMVMatrix01
gcu_Weightback to summary
public final GLUniformData gcu_Weight
rsIdback to summary
private int rsId

Constructor Detail

ProgramLocalback to summary
public ProgramLocal()

Method Detail

getRenderStateIdback to summary
public final int getRenderStateId()
toStringback to summary
public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
updateback to summary
public final boolean update(final GL2ES2 gl, final RenderState rs, final boolean updateLocation, final int renderModes, final boolean pass1, final boolean throwOnError)

Since RenderState data is being used in multiple ShaderPrograms the data must always be written.

Parameters
throwOnError:boolean

TODO

Returns:boolean

true if no error occurred, i.e. all locations found, otherwise false.