VertexArrayObject
Methods
addAttributeArray
Bind a buffer to a program attribute.
| Argument | Type | Required | Description |
|---|---|---|---|
program | Yes | The bound shader program. | |
buffer | Yes | The array buffer holding the attribute. | |
name | Yes | The attribute name in the program. | |
offset | Yes | The offset in bytes of the attribute inside a block. | |
stride | Yes | The size in bytes of a block. | |
elementType | Yes | The GL type of a component. | |
elementTupleSize | Yes | The number of components. | |
normalize | Yes | Whether integer components are normalized. |
Returns
| Type | Description |
|---|---|
| boolean | False when the attribute could not be bound. |
addAttributeArrayWithDivisor
Bind a buffer to a program attribute, optionally instanced.
| Argument | Type | Required | Description |
|---|---|---|---|
program | Yes | The bound shader program. | |
buffer | Yes | The array buffer holding the attribute. | |
name | Yes | The attribute name in the program. | |
offset | Yes | The offset in bytes of the attribute inside a block. | |
stride | Yes | The size in bytes of a block. | |
elementType | Yes | The GL type of a component. | |
elementTupleSize | Yes | The number of components. | |
normalize | Yes | Whether integer components are normalized. | |
divisor | Yes | When greater than zero, the attribute advances per instance. | |
isMatrix | Yes | Whether the attribute is one row of a matrix attribute. |
Returns
| Type | Description |
|---|---|
| boolean | False when the attribute could not be bound. |
addAttributeMatrixWithDivisor
Bind a buffer to a matrix program attribute, one attribute slot per row.
| Argument | Type | Required | Description |
|---|---|---|---|
program | Yes | The bound shader program. | |
buffer | Yes | The array buffer holding the attribute. | |
name | Yes | The attribute name in the program. | |
offset | Yes | The offset in bytes of the attribute inside a block. | |
stride | Yes | The size in bytes of a block. | |
elementType | Yes | The GL type of a component. | |
elementTupleSize | Yes | The number of rows and columns of the matrix. | |
normalize | Yes | Whether integer components are normalized. | |
divisor | Yes | When greater than zero, the attribute advances per instance. |
Returns
| Type | Description |
|---|---|
| boolean | False when the attribute could not be bound. |
bind
Bind the vertex array object, creating it if needed.
extend
Method used to decorate a given object (publicAPI+model) with vtkOpenGLVertexArrayObject characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IOpenGLVertexArrayObjectInitialValues | No | (default: {}) |
initialize
Create the underlying GL vertex array object.
isReady
Whether the GL vertex array object exists.
newInstance
Method used to create a new instance of vtkOpenGLVertexArrayObject.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IOpenGLVertexArrayObjectInitialValues | No | for pre-setting some of its content |
release
Unbind the vertex array object.
releaseGraphicsResources
Delete the vertex array object.
removeAttributeArray
The attribute state lives inside the vertex array object and is overwritten on the next bind, so this only reports whether the object is usable.
| Argument | Type | Required | Description |
|---|---|---|---|
name | Yes | The attribute name in the program. |
setOpenGLRenderWindow
Attach this vertex array object to an OpenGL render window, releasing any resources held for a previous one.
| Argument | Type | Required | Description |
|---|---|---|---|
renWin | Yes | The OpenGL render window. |
shaderProgramChanged
Drop the vertex array object so that it is rebuilt against the new program.