// Do random somthing so the uniform variables exist when
// when glGetUniformLocationARB is called.
tmp = foo_single.bar;
tmp = foo_array[ 0 ].bar;
gl_Position = ftransform( );
}
Then calling:
uloc = glGetUniformLocationARB( prog, “foo_single.bar” );
will return a valid location.
uloc = glGetUniformLocationARB( prog, “foo_array[ 0 ].bar” );
will return an invalid location(-1) To my reading of the Orange Book pg. 189 this should be valid.
Don’t think of -1 as “invalid location” but as “not active”.
tmp is never used in a meaningful manner, the compiler should have optimized both foo structs away. If it didn’t, it sucks.
Your error is something else:
Don’t include your source code formatting into the query: Use “[0]” instead of “[ 0 ]”. It’s not source code, it’s a string constant and it has a specific required form!