示例#1
0
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            string name = NewUniformName;
            GLType type = (GLType)typeComboBox.SelectedItem;

            NewUniform = UniformMaker.Make(type, name);
            Close();
        }
示例#2
0
        public AttributeInfo(string id, string name, GLType type)
        {
            Debug.Assert(VariableMaker.GetSupportedTypes().Contains(type));

            Id   = id;
            Name = name;
            Type = type;
        }
示例#3
0
        /// <summary>
        /// Makes variable of specified type.
        /// </summary>
        /// <param name="type">Type of variable to be created. It should be one of the supported types
        /// </param>
        public static GLVariable Make(GLType type)
        {
            VariableCreator creator;

            if (creatorsDictionary.TryGetValue(type, out creator))
            {
                var result = creator();
                return(result);
            }

            return(null);
        }
示例#4
0
        /// <summary>
        /// Makes AttributeInfo of specified type and name.
        /// </summary>
        /// <param name="type">OpenGL type of the new attribute</param>
        /// <param name="name">Name of the new attribute</param>
        /// <returns></returns>
        public static AttributeInfo Make(GLType type, string name)
        {
            string id = (nextId++).ToString();

            return(new AttributeInfo(id, name, type));
        }
示例#5
0
        /// <summary>
        /// Makes Uniform from a specified GLSL type.
        /// </summary>
        /// <param name="type">GLSL type of the uniform. It should be one of the supported ones.</param>
        /// <param name="name">Name of the new uniform.</param>
        /// <returns>The newly created uniform.</returns>
        public static Uniform Make(GLType type, string name)
        {
            GLVariable variable = VariableMaker.Make(type);

            return(new Uniform(name, variable));
        }