Hi! How to pass in shader matrix 4x4?
vert.glsl:
attribute vec4 a_position;
attribute vec4 a_color;
uniform mat4 u_MVP;
varying vec4 v_color;
void main()
{
v_color = a_color;
gl_Position = u_MVP * a_position;
}
main.cpp
glm::mat4 projectionMatrix;
glm::mat4 viewMatrix;
glm::mat4 modelMatrix;
sf::Shader shader;
//...
if (!shader.loadFromFile("res/shaders/vert.glsl", "res/shaders/frag.glsl"))
{
exit(1);
}
//...
sf::Shader::bind(&shader);
shader.setParameter("u_MVP", glm::value_ptr(projectionMatrix * viewMatrix * modelMatrix)); // error
//...
sf::Shader::bind(NULL);
Error in shader.setParameter. Please tell me the solution?