| 1039 | } |
| 1040 | |
| 1041 | bool 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 | |
| 1063 | int vtkShaderProgram::FindAttributeArray(const char* cname) |
| 1064 | { |
no test coverage detected