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

Method SetAttributeArrayInternal

Rendering/OpenGL2/vtkShaderProgram.cxx:1041–1061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1039}
1040
1041bool vtkShaderProgram::SetAttributeArrayInternal(const char* name, void* buffer, int type,
1042 int tupleSize, vtkShaderProgram::NormalizeOption normalize)
1043{
1044 if (type == -1)
1045 {
1046 this->Error = "Unrecognized data type for attribute ";
1047 this->Error += name;
1048 return false;
1049 }
1050 GLint location = static_cast<GLint>(this->FindAttributeArray(name));
1051 if (location == -1)
1052 {
1053 this->Error = "Could not set attribute (does not exist) ";
1054 this->Error += name;
1055 return false;
1056 }
1057 const GLvoid* data = static_cast<const GLvoid*>(buffer);
1058 glVertexAttribPointer(location, tupleSize, convertTypeToGL(type),
1059 normalize == Normalize ? GL_TRUE : GL_FALSE, 0, data);
1060 return true;
1061}
1062
1063int vtkShaderProgram::FindAttributeArray(const char* cname)
1064{

Callers 1

SetAttributeArrayMethod · 0.95

Calls 2

FindAttributeArrayMethod · 0.95
convertTypeToGLFunction · 0.70

Tested by

no test coverage detected