Beispiel #1
0
 public void CreateIndexBuffer(int[] indices)
 {
     this._indexVbo = VertexBufferObject.Create(BufferTarget.ElementArrayBuffer);
     _indexVbo.Bind();
     _indexVbo.StoreData(indices);
     this._indexCount = indices.Length;
 }
Beispiel #2
0
            public void CreateAttribute(int attribute, float[] data, int attrSize)
            {
                VertexBufferObject dataVbo = VertexBufferObject.Create(BufferTarget.ArrayBuffer);

                dataVbo.Bind();
                dataVbo.StoreData(data);
                GL.VertexAttribPointer(attribute, attrSize, VertexAttribPointerType.Float, false, attrSize * BYTES_PER_FLOAT, 0);
                dataVbo.Unbind();
                _dataVbos.Add(dataVbo);
            }
Beispiel #3
0
            public void CreateIntAttribute(int attribute, int[] data, int attrSize)
            {
                VertexBufferObject dataVbo = VertexBufferObject.Create(BufferTarget.ArrayBuffer);

                dataVbo.Bind();
                dataVbo.StoreData(data);
                GL.VertexAttribIPointer(attribute, attrSize, VertexAttribIntegerType.Int, attrSize * BYTES_PER_INT, System.IntPtr.Zero);

                dataVbo.Unbind();
                _dataVbos.Add(dataVbo);
            }