Well, the API type assumes that if you know the name of the uniform, you also know the type (these two things are written next to each other in the code), so it does not allow you to easily access the type by name.
However, you can iterate over all active forms with glGetActiveUniformARB to find the one that interests you. Also note that this will only return valid data if the uniform is actually active (i.e., the GLSL compiler considers it useful for final calculations).
(Typically, the expected use is to iterate over all uniforms, retrieve the name and type, and then get their location on behalf of in order to know how to update them at runtime. Not vice versa).
Bahbar
source share