BufferObject
Introduction
Object containing the newInstance and extend functions for vtkOpenGLBufferObject.
Methods
bind
Binds the buffer object.
Returns
| Type | Description |
|---|---|
| boolean | Whether the binding was successful. |
extend
Extends the given object with the properties and methods of vtkOpenGLBufferObject.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | The public API to extend. | |
model | Yes | The model to extend. | |
initialValues | Yes | The initial values to apply. |
generateBuffer
Generates the underlying WebGL buffer if needed.
| Argument | Type | Required | Description |
|---|---|---|---|
type | Yes | The type of the buffer object. |
Returns
| Type | Description |
|---|---|
| boolean | Whether the generated buffer is compatible with the given type. |
getAllocatedGPUMemoryInBytes
Gets the amount of GPU memory allocated by the buffer object in bytes.
Returns
| Type | Description |
|---|---|
| number | The allocated GPU memory in bytes. |
getError
Retrieves the error message, if any.
Returns
| Type | Description |
|---|---|
| string | The error message. |
getHandle
Gets the WebGL handle of the buffer object.
Returns
| Type | Description |
|---|---|
| The WebGL buffer handle. |
getOpenGLRenderWindow
Gets the OpenGL render window.
Returns
| Type | Description |
|---|---|
| The render window. |
getType
Gets the type of the buffer object.
Returns
| Type | Description |
|---|---|
| Nullable<ObjectType> | The type of the buffer object. |
isReady
Checks if the buffer object is ready, i.e. data has been uploaded.
Returns
| Type | Description |
|---|---|
| boolean | Whether the buffer object is ready. |
newInstance
Creates a new instance of vtkOpenGLBufferObject with the given initial values.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | Yes | The initial values to use. |
Returns
| Type | Description |
|---|---|
| vtkOpenGLBufferObject | The new instance. |
release
Releases the buffer object.
Returns
| Type | Description |
|---|---|
| boolean | Whether the release was successful. |
releaseGraphicsResources
Releases graphics resources associated with the buffer object.
setOpenGLRenderWindow
Sets the OpenGL render window.
| Argument | Type | Required | Description |
|---|---|---|---|
renWin | Yes | The render window to set. |
setType
Sets the type of the buffer object.
| Argument | Type | Required | Description |
|---|---|---|---|
value | Yes | The type to set. |
upload
Uploads data to the buffer object.
| Argument | Type | Required | Description |
|---|---|---|---|
data | Yes | The data to be uploaded. | |
type | Yes | The type of the data. |
Returns
| Type | Description |
|---|---|
| boolean | Whether the upload was successful. |