Exemplo n.º 1
0
        void SetUniform(string name, IUniformValue uniformValue)
        {
            bool same = false;

            if (_uniformValues.ContainsKey(name))
            {
                same = _uniformValues[name].Equals(uniformValue);
                _uniformValues[name] = uniformValue;
            }
            else
            {
                _uniformValues.Add(name, uniformValue);
            }

            // Do not attempt to set uniform for invalid shaders
            if (!same && _valid)
            {
                uniformValue.Set(_handle, GetUniformLocation(name));
            }
        }