|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.graphics.opengl.GLVertexAttribute
public class GLVertexAttribute
The OpenGL counterpart of the VertexAttribute class for GMesh It stores attribute data in FloatBuffer format, ready for rendering operations.
| Field Summary | |
|---|---|
private int |
attribSize
|
private int |
attributeIndex
|
private String |
attributeName
|
private boolean |
bufferModified
|
private int |
bufferOffset
|
private int |
byteBufferSize
|
private int |
floatBufferSize
|
private int |
nrOfVertices
|
private int |
texUnit
|
private FloatBuffer |
vertexDataBuffer
|
| Constructor Summary | |
|---|---|
GLVertexAttribute(String attrName,
float[] vertexData,
int attribSize,
int nrOfVertices,
int texUnit)
Create a new GLVertexAttribute |
|
GLVertexAttribute(VertexAttribute va)
Create a new GLVertexAttribute from a generic VertexAttribute |
|
| Method Summary | |
|---|---|
StringBuffer |
appendTo(StringBuffer buf)
|
String |
getAttributeName()
|
int |
getByteBufferSize()
Returns the buffer size, in number of bytes |
String |
getName()
Returns the GLAttribute name. |
int |
getNrOfVertices()
Returns the number of vertices |
int |
getTexUnit()
|
float[] |
getVertexData(float[] vertexData)
Fills and returns the vertexData float array with the current contents of the vertex data buffer. |
void |
glInit(GLBinding gl)
|
void |
glRender(GLBinding gl)
GL render for this attribute. |
void |
setArrayBufferOffset(int offset)
Sets the GL_ARRAY_BUFFER buffer offset |
int |
setAttributeIndex(GLBinding gl,
int prog)
Sets the GLSL attribute index for the specified shader program, by queriying for the attribute location. |
void |
setTexUnit(int texUnit)
Sets the texture unit to be used for this (texture) attribute |
void |
setVertexData(float[] vertexData)
Sets vertex data, by copying from the specified array. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private String attributeName
private int attributeIndex
private int texUnit
private FloatBuffer vertexDataBuffer
private int floatBufferSize
private int byteBufferSize
private int attribSize
private boolean bufferModified
private int bufferOffset
private int nrOfVertices
| Constructor Detail |
|---|
public GLVertexAttribute(String attrName,
float[] vertexData,
int attribSize,
int nrOfVertices,
int texUnit)
public GLVertexAttribute(VertexAttribute va)
| Method Detail |
|---|
public String getAttributeName()
public String toString()
toString in class Objectpublic StringBuffer appendTo(StringBuffer buf)
public void setTexUnit(int texUnit)
public int getTexUnit()
public String getName()
public int getNrOfVertices()
public int getByteBufferSize()
public void setArrayBufferOffset(int offset)
public void setVertexData(float[] vertexData)
public float[] getVertexData(float[] vertexData)
public int setAttributeIndex(GLBinding gl,
int prog)
public void glInit(GLBinding gl)
public void glRender(GLBinding gl)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||