| 84 | } |
| 85 | |
| 86 | void vtkDrawTexturedElements::BindArrayToTexture( |
| 87 | vtkStringToken textureName, vtkDataArray* array, bool asScalars) |
| 88 | { |
| 89 | auto it = this->Arrays.find(textureName); |
| 90 | #ifdef vtkDrawTexturedElements_DEBUG |
| 91 | std::cout << "Bind " << array->GetObjectDescription() << "to texture " << textureName.Data() |
| 92 | << std::endl; |
| 93 | #endif |
| 94 | if (it == this->Arrays.end()) |
| 95 | { |
| 96 | this->Arrays[textureName] = vtkOpenGLArrayTextureBufferAdapter(array, asScalars); |
| 97 | return; |
| 98 | } |
| 99 | it->second.Arrays = { array }; |
| 100 | // needs to be re-uploaded. |
| 101 | if (it->second.Buffer) |
| 102 | { |
| 103 | it->second.Buffer->FlagBufferAsDirty(); |
| 104 | } |
| 105 | it->second.ScalarComponents = asScalars; |
| 106 | } |
| 107 | |
| 108 | bool vtkDrawTexturedElements::UnbindArray(vtkStringToken textureName) |
| 109 | { |
no test coverage detected