public class UserConstant extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
private float[] |
m_afData
Data
|
private int |
m_iBaseRegister
Base register (nonnegative)
|
private int |
m_iNumFloats
Data size.
|
private int |
m_iRegisterQuantity
Register quantity (positive)
|
private String |
m_kName
UserConstant name.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
UserConstant(String kProgramName,
String rkName,
int iBaseRegister,
int iRegisterQuantity,
int iNumFloats)
Construction and destruction.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Delete memory.
|
int |
GetBaseRegister()
Member access.
|
float[] |
GetData()
Member access.
|
float |
GetData(int iPos)
The Shader base class provides storage for the user constants and
will set the float pointer to this storage when the shader program is
loaded.
|
int |
GetDataSize()
Get the number of floats.
|
String |
GetName()
Return name of this UserConstant.
|
int |
GetRegisterQuantity()
Member access.
|
void |
SetData(int iPos,
float fValue)
The Shader base class provides storage for the user constants and
will set the float pointer to this storage when the shader program is
loaded.
|
void |
SetDataSource(float[] afData)
The Shader base class provides storage for the user constants and
will set the float pointer to this storage when the shader program is
loaded.
|
private static final long serialVersionUID
private String m_kName
private int m_iBaseRegister
private int m_iRegisterQuantity
private float[] m_afData
private int m_iNumFloats
public UserConstant(String kProgramName, String rkName, int iBaseRegister, int iRegisterQuantity, int iNumFloats)
kProgramName
- the name of the program the UserConstant belogs to.rkName
- the name of the UserConstantiBaseRegister
- (nonnegative)iRegisterQuantity
- (positive)iNumFloats
- the number of floats represented by this parameter.public void dispose()
public final int GetBaseRegister()
public final float[] GetData()
public float GetData(int iPos)
iPos
- position in data array to read.public final int GetDataSize()
public final String GetName()
public final int GetRegisterQuantity()
public void SetData(int iPos, float fValue)
iPos
- position in data array to write.fValue
- new value.public void SetDataSource(float[] afData)
afData
- data source.