I am trying to learn OpenGL and following this: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/
Up until the point where they started passing mat
Consider using value_ptr rather then &MVP[0][0]
glUniformMatrix4fv(MatrixID, 1, GL_FALSE, glm::value_ptr(MVP));
genType::value_type const* glm::value_ptr (genType const & vec)
Return the constant address to the data of the input parameter
glUniform*()
calls set values for the current program. You need to call glUseProgram()
before the glUniform*()
call. In this example:
glUseProgram(programID);
glUniformMatrix4fv(MatrixID, 1, GL_FALSE, &MVP[0][0]);