Everything works and when I start adding the projection matrix everything fails to load. I just want to know what is causing the problem everything seems to be fine. I’m adding it in my shaders. I load a 4x4 matrix to the uniform. I also create the projection matrix. I don’t know what else I’m doing wrong.
vertShader
gl_Position = projectionMatrix * transformationMatrix * vec4(position, 1.0f);
shader source file
void StaticShader::getAllUniformLocations()
{
m_LocationTransformMatrix = super::getUniformLocation("transformationMatrix");
m_LocationProjectionMatrix = super::getUniformLocation("projectionMatrix");
}
void StaticShader::loadProjectionMatrix(glm::mat4& projection)
{
super::loadMatrix(m_LocationProjectionMatrix, projection);
}
renderer source file
NEAR_PLANE is a static constant float and same goes for FAR_PLANE
Renderer::Renderer(shader::StaticShader& shader)
{
glm::mat4 projectionMatrix = projectionMatrix = glm::perspective(70.0f, 800.0f / 700.0f, NEAR_PLANE, FAR_PLANE);
shader.enable();
shader.loadProjectionMatrix(projectionMatrix);
shader.disable();
}