예제 #1
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();
        }
예제 #2
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();
        }
예제 #3
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();
        }
예제 #4
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();
        }
예제 #5
0
 protected VboBase this[VboPosition id]
 {
     get { return m_vbos[(int)id]; }
     set { m_vbos[(int)id] = value; }
 }
예제 #6
0
 protected void Update <T>(VboPosition id, T[] data, int count = -1, int offset = 0)
     where T : struct
 {
     // No cast checking, should be covered by tests and usage
     ((Vbo <T>) base[id]).Update(data, count, offset);
 }
예제 #7
0
 protected VboBase this[VboPosition id]
 {
     get { return(m_vbos[(int)id]); }
     set { m_vbos[(int)id] = value; }
 }