Passing uniform 4x4 matrix to vertex shader program

前端 未结 2 895
南笙
南笙 2021-02-14 00:58

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

2条回答
  •  臣服心动
    2021-02-14 01:27

    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

提交回复
热议问题