MCPcopy Create free account
hub / github.com/Kitware/VTK / BindArrayToTexture

Method BindArrayToTexture

Rendering/OpenGL2/vtkDrawTexturedElements.cxx:86–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void 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
108bool vtkDrawTexturedElements::UnbindArray(vtkStringToken textureName)
109{

Callers 2

PrepareHelperMethod · 0.80

Calls 5

findMethod · 0.45
GetObjectDescriptionMethod · 0.45
DataMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected