Example #1
0
        public void bind(ref Shader shader)
        {
            GL.BindBuffer(BufferTarget.ArrayBuffer, bufferHandle);

            if (dirty)
            {
                bufferChange();
                dirty = false;
            }

            for (int i = 0; i < attributes.size(); i++)
            {
                VertexAttribute attr     = attributes.get(i);
                int             location = shader.attribute(attr.alias);
                GL.EnableVertexAttribArray(location);
                GL.VertexAttribPointer(location, attr.numComponents, VertexAttribPointerType.Float, false, attributes.vertexSize, attr.offset);
            }
        }