コード例 #1
0
 public static void SetVertexArray(VertexArray varray)
 {
     if (curVarray != null && varray.id != curVarray.id)
     {
         GPUStateMachine.UnbindVertexArray();
     }
     curVarray = varray;
 }
コード例 #2
0
        public void SetBufferObject(int index, GPUBuffer buffer, int elementCount, VertexAttribPointerType type)
        {
            GPUStateMachine.BindVertexArray(id);

            GL.EnableVertexAttribArray(index);
            GPUStateMachine.BindBuffer(buffer.target, buffer.id);
            GL.VertexAttribPointer(index, elementCount, type, false, 0, 0);
            GPUStateMachine.UnbindBuffer(buffer.target);

            GPUStateMachine.UnbindVertexArray();
        }