I write glsl wrapper for education purposes, but I stopped because I have some misunderstanding. When I want insert variable to specific location, I have mismatch warning. Because location is GLint, but glVertexAttrib location must be GLuint.
Here's my code sample
bool Material::AddAttrib(GLchar *variable, std::vector<GLdouble> values) {
GLint location = glGetAttribLocation(program,variable);
GLenum error = glGetError();
bool isNor = PrintError(error);
if(!isNor) return isNor;
switch (values.size()) {
case 1:
glVertexAttrib1d(location, values.at(0));
break;
case 2:
glVertexAttrib2d(location, values.at(0), values.at(1));
break;
case 3:
glVertexAttrib3d(location, values.at(0), values.at(1), values.at(2));
break;
case 4:
glVertexAttrib4d(location, values.at(0), values.at(1), values.at(2), values.at(3));
break;
default:
PrintErrorSize();
return false;
}
error = glGetError();
isNor = PrintError(error);
return isNor;
}