public void SetVertexAttrib(uint index, GpuBuffer buffer, int size, DataType type, bool normalized = false, int stride = 0, uint offset = 0) { Bind(); buffer.Bind(); GL.VertexAttribPointer(index, size, (uint)type, normalized, stride, new IntPtr(offset)); GL.EnableVertexAttribArray(index); }
public static GpuBuffer[] Create(int n, BufferTarget target = BufferTarget.Array) { uint[] handles = new uint[n]; GL.GenBuffers(n, handles); var result = new GpuBuffer[n]; for (int i = 0; i < n; i++) { result[i] = new GpuBuffer(handles[i], target); } return(result); }
public static GpuBuffer[] Create(BufferTarget[] targets) { int n = targets.Length; uint[] handles = new uint[n]; GL.GenBuffers(n, handles); var result = new GpuBuffer[n]; for (int i = 0; i < n; i++) { result[i] = new GpuBuffer(handles[i], targets[i]); } return(result); }