예제 #1
0
        public void EnableAttribI(
            VboPosition id, int attribArrayIdx = -1,
            VertexAttribIntegerType type       = VertexAttribIntegerType.Int,
            int stride = 0, int offset = 0)
        {
            if (attribArrayIdx < 0)
            {
                attribArrayIdx = (int)id;
            }


            VboBase vboBase = this[id];

            GL.BindVertexArray(Handle);
            vboBase.Bind();

            GL.EnableVertexAttribArray(attribArrayIdx);
            GL.VertexAttribIPointer(attribArrayIdx, vboBase.ElementSize, type, stride, new IntPtr(offset));

            //GL.BindVertexArray(0);
            //VboBase.Unbind();
        }
예제 #2
0
        public void EnableAttrib(
            VboPosition id, int attribArrayIdx = -1,
            VertexAttribPointerType type       = VertexAttribPointerType.Float,
            bool normalized = false,
            int stride      = 0, int offset = 0)
        {
            if (attribArrayIdx < 0)
            {
                attribArrayIdx = (int)id;
            }


            VboBase vboBase = this[id];

            GL.BindVertexArray(Handle);
            vboBase.Bind();

            GL.EnableVertexAttribArray(attribArrayIdx);
            GL.VertexAttribPointer(attribArrayIdx, vboBase.ElementSize, type, normalized, stride, offset);

            //GL.BindVertexArray(0);
            //VboBase.Unbind();
        }