TextureUnitManager
Methods
allocate
Reserve the first free texture unit.
Returns
| Type | Description |
|---|---|
| number | The unit number, or -1 when none is free. |
allocateUnit
Reserve a specific texture unit.
| Argument | Type | Required | Description |
|---|---|---|---|
unit | Yes | The unit to reserve. |
Returns
| Type | Description |
|---|---|
| number | The unit number, or -1 when it was already allocated. |
deleteTable
Drop the allocation table, reporting any unit that was not released.
extend
Method used to decorate a given object (publicAPI+model) with vtkOpenGLTextureUnitManager 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 | IOpenGLTextureUnitManagerInitialValues | No | (default: {}) |
free
Release a texture unit.
| Argument | Type | Required | Description |
|---|---|---|---|
val | Yes | The unit to release. |
freeAll
Release every texture unit.
getContext
Get the WebGL context.
getNumberOfTextureUnits
Get the number of texture units the context exposes.
isAllocated
Whether the given texture unit is allocated.
| Argument | Type | Required | Description |
|---|---|---|---|
textureUnitId | Yes | The unit to test. |
newInstance
Method used to create a new instance of vtkOpenGLTextureUnitManager.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IOpenGLTextureUnitManagerInitialValues | No | for pre-setting some of its content |
setContext
Set the WebGL context and size the allocation table from MAX_TEXTURE_IMAGE_UNITS.
| Argument | Type | Required | Description |
|---|---|---|---|
context | Yes | The WebGL context. |