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

Method FindAttributeArray

Rendering/OpenGL2/vtkShaderProgram.cxx:1063–1084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1061}
1062
1063int vtkShaderProgram::FindAttributeArray(const char* cname)
1064{
1065 if (cname == nullptr || !this->Linked)
1066 {
1067 return -1;
1068 }
1069
1070 GLint loc = -1;
1071
1072 IterT iter = this->AttributeLocs.find(cname);
1073 if (iter == this->AttributeLocs.end())
1074 {
1075 loc = glGetAttribLocation(static_cast<GLuint>(Handle), static_cast<const GLchar*>(cname));
1076 const char* allocStr = strdup(cname);
1077 this->AttributeLocs.insert(std::make_pair(allocStr, static_cast<int>(loc)));
1078 }
1079 else
1080 {
1081 loc = iter->second;
1082 }
1083 return loc;
1084}
1085
1086int vtkShaderProgram::FindUniform(const char* cname)
1087{

Callers 6

EnableAttributeArrayMethod · 0.95
DisableAttributeArrayMethod · 0.95
UseAttributeArrayMethod · 0.95
IsAttributeUsedMethod · 0.95

Calls 4

strdupFunction · 0.85
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected