public void CreateIndexBuffer(int[] indices) { this._indexVbo = VertexBufferObject.Create(BufferTarget.ElementArrayBuffer); _indexVbo.Bind(); _indexVbo.StoreData(indices); this._indexCount = indices.Length; }
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); }
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); }