Beispiel #1
0
        public void BindAttribute(string attrName)
        {
            AttributeProperties attr = this.GetAttributeByName(attrName);

            GL.BindAttribLocation(ProgramId, attr.Id, attr.Name);
            //GL.BindAttribLocation(ProgramId, 0, "vPosition")
        }
Beispiel #2
0
        private void IntrospectAttributes()
        {
            int count;

            GL.GetProgram(ProgramId, All.ActiveAttributes, out count);
            for (int i = 0; i < count; i++)
            {
                const int     bufSize = 64;
                int           currAttrLen, currAttrSize;
                All           currType;
                StringBuilder currAttrName = new StringBuilder(bufSize);
                GL.GetActiveAttrib(ProgramId, i, bufSize, out currAttrLen, out currAttrSize, out currType, currAttrName);
                AttributeProperties currAttr = new AttributeProperties {
                    Id = i, Name = currAttrName.ToString(), Type = currType
                };
                attributes.Add(currAttr);
            }
        }