I added this code before linking with:
glLinkProgramARB(Shader_Program)
GLfloat modelview[16]; glGetFloatv(GL_MODELVIEW_MATRIX, modelview); GLfloat projection[16]; glGetFloatv(GL_PROJECTION_MATRIX, projection); GLuint loc;GLuint loc2;loc = glGetUniformLocationARB(Component::Shader_Program,"ModelViewMatrix");glUniform4fvARB(loc,4,modelview);loc2 = glGetUniformLocationARB(Component::Shader_Program,"ProjectionMatrix");glUniform4fvARB(loc2,4,projection);
gluLookAt()
and never had to touch the matrices directly.This changes the vert shader to:
#version 150uniform mat4 ProjectionMatrix;uniform mat4 ModelviewMatrix;in vec4 inVertex;in vec2 inTexCoord0;out vec2 outTexCoord0;void main(){ gl_Position = ProjectionMatrix * ModelviewMatrix * inVertex; outTexCoord0 = inTexCoord0;}