Esempio n. 1
0
        public ProgramAttribute VertexAttribute(string name)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            ProgramAttribute attrib = _attributes.FirstOrDefault(a => a.Name == name);

            if (attrib == null)
            {
                throw new ArgumentException(string.Format("Attribute not found: {0}", name), "name");
            }

            return(attrib);
        }
Esempio n. 2
0
        internal void MapAttributes()
        {
            int count = 0;

            GL.GetProgram(_id, ProgramParameter.ActiveAttributes, out count);

            _attributes.Clear();
            for (int i = 0; i < count; i++)
            {
                int size;
                ActiveAttribType type;

                string name = GL.GetActiveAttrib(_id, i, out size, out type);
                int    slot = GL.GetAttribLocation(_id, name);

                ProgramAttribute attribute = new ProgramAttribute(name, slot, size, type);
                _attributes.Add(attribute);
            }
        }