I am trying to make function for setting shader uniforms, but when I try to compile it I get this error :
Error 2 error C2719: 'value': formal parameter with __declspec(align('16')) won't be aligned
Here is code of function:
void Shader::setUniform(std::string name, const glm::mat4 value){
GLint uniform = glGetUniformLocation(m_program, name.c_str());
glUniformMatrix4fv(uniform, 1, GL_FALSE, (GLfloat*)&value);
}
I am using Visual studio 2013.
From Microsoft's documentation on that error:
The align __declspec modifier is not permitted on function parameters.
Don't copy the parameter to an unaligned location. Pass a constant reference to the existing, already-aligned data.
void Shader::setUniform(const std::string &name, const glm::mat4 & value)
// ^^^^^ ^
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With