I am using Open GL to draw in a GLArea. I have a working prototype and am now trying to add the required matrix stuff for aspect ratio rotation etc.
I have my shaders and GlProgram loading and working, but can’t successfully get the uniform location.
The vertex shader is
#version 330
layout (location = 0) in vec3 Position;
out vec3 vColor;
uniform mat4 perspective;
uniform mat4 matrix;
void main()
{
gl_Position = vec4(Position, 1.0) * perspective * matrix;
vColor = vec3(0.75, 1.0, 1.0);
}
and I try to get the uniform location in my render code with
let p = gl::GetUniformLocation(program_id, "perspective".as_ptr() as *const gl::types::GLchar);
but this always returns -1
I have also tried making this call directly after linking the program, but still get -1