I found Gwen a few days ago and thought it looked like the perfect GUI toolkit for my project. But oh, dear, look at all that OpenGL 2 code in the renderer. So I thought I'd write an OpenGL 3 renderer so I can actually use it, but I'm a lot more familiar with CG than GLSL and I've gotten myself stuck writing up the sample. I think if I can just get these uniform variables set, it should be basically done.
The shaders compile and link without a problem. I narrowed it down to glGetUniformLocation returning -1 for the orthographic matrix and the texture sampler, but I don't know why exactly it's doing that. The typical problem seems to be that if you aren't actually using them, they get optimized out, but I've used them both.
If anybody has any ideas, I'm all ears. Will be more than happy to post/link the full thing once it works properly. This is my first stab at GLSL, so I could easily be doing something dumb. I did just get finished setting up CG for another project, so I'm not completely clueless.
Shader Init code called after setting up the OpenGL context:
void InitializeShaders(void)
{
g_ShaderProgram = glCreateProgram();
g_VertexShader = glCreateShader(GL_VERTEX_SHADER);
g_FragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(g_VertexShader, 1, (const GLchar **)&VertexShaderData, 0);
glShaderSource(g_FragmentShader, 1, (const GLchar **)&FragmentShaderData, 0);
glCompileShader(g_VertexShader);
CheckShaderCompile(g_VertexShader);
glCompileShader(g_FragmentShader);
CheckShaderCompile(g_FragmentShader);
glAttachShader(g_ShaderProgram, g_VertexShader);
glAttachShader(g_ShaderProgram, g_FragmentShader);
glBindAttribLocation(g_ShaderProgram, 0, "position");
glBindAttribLocation(g_ShaderProgram, 1, "color");
glBindAttribLocation(g_ShaderProgram, 2, "texCoord");
glBindFragDataLocation(g_ShaderProgram, 0, "color");
glLink