I have a uniform in a shader like this:
uniform vec3 origins[10];
and a std::vector in my code like this:
std::vector<glm::vec3> origins;
that is filled with ten glm::vec3 elements.
Does anyone know how do I pass that to the shader? I thought:
GLint originsLoc = glGetUniformLocation(programID, "origins");
glUniform3fv(originsLoc, 10, origins.data());
would do it, but it wont compile. The error says there is no matching function for call to 'glUniform3fv'. How do I pass the data in the std::vector in a way that satisfies the glUniform3fv function?
no matching function for call to 'glUniform3fv'. I edited the question with this info.const GLfloat*. Without the cast, the function signature doesn't match. You should also include the *full compiler output. I'm guessing the actual error includes extra type/signature information that you have omitted, unfortunately.