示例#1
0
        public void Draw()
        {
            vao.Bind();
            ind.Bind();

            GL.DrawElements(BeginMode.Triangles, length,
                            DrawElementsType.UnsignedInt, IntPtr.Zero);

            VAO.Unbind();
            ind.Unbind();
        }
示例#2
0
        public void Create(Vector3[] positionVboData,Vector3[] normalVboData, int[] indicesVboData)
        {
            length = indicesVboData.Length;
            VBO pos, nor;

            pos = new VBO();
            pos.Create<Vector3>(BufferTarget.ArrayBuffer, positionVboData);

            nor = new VBO();
            nor.Create<Vector3>(BufferTarget.ArrayBuffer, normalVboData);

            ind = new VBO();
            ind.Create<int>(BufferTarget.ElementArrayBuffer, indicesVboData);

            vao = new VAO();
            vao.Create();
            vao.SetVertexAttribPointer(0, 3, pos);
            vao.SetVertexAttribPointer(1, 3, nor);
            VAO.Unbind();
        }
示例#3
0
        public void Create(Vector3[] positionVboData, Vector3[] normalVboData, int[] indicesVboData)
        {
            length = indicesVboData.Length;
            VBO pos, nor;

            pos = new VBO();
            pos.Create <Vector3>(BufferTarget.ArrayBuffer, positionVboData);

            nor = new VBO();
            nor.Create <Vector3>(BufferTarget.ArrayBuffer, normalVboData);

            ind = new VBO();
            ind.Create <int>(BufferTarget.ElementArrayBuffer, indicesVboData);

            vao = new VAO();
            vao.Create();
            vao.SetVertexAttribPointer(0, 3, pos);
            vao.SetVertexAttribPointer(1, 3, nor);
            VAO.Unbind();
        }