public int GetUniformLocation(string uniformName)
{
// If we don't have the uniform name in the dictionary, get it's
// location and add it.
int location;
if (!uniformNamesToLocations.TryGetValue(uniformName, out location))
{
location = glGetUniformLocation(this.ProgramId, uniformName);
if (location < 0)
{ Debug.WriteLine(string.Format("No uniform found for the name [{0}]", uniformName)); }
uniformNamesToLocations[uniformName] = location;
}
// Return the uniform location.
return location;
}