public void BindBuffer(string AttributeName, GfxBuffer Array, int Stride = 0, int Offset = 0) { int AttribLocation = GetAttribLocation(AttributeName); if (AttribLocation == -1) { throw new Exception(string.Format("Attribute '{0}' could not be found", AttributeName)); } BindBuffer(AttribLocation, Array, Stride, Offset); }
public void BindBuffer(int AttributeName, GfxBuffer Array, int Stride = 0, int Offset = 0) { GL.EnableVertexArrayAttrib(ID, AttributeName); GL.VertexArrayVertexBuffer(ID, AttributeName, Array.ID, (IntPtr)Offset, Array.Size * Marshal.SizeOf(Array.DataType)); GL.VertexArrayAttribFormat(ID, AttributeName, Array.Size, Array.AttribType, false, Stride); }
public void BindIndexBuffer(GfxBuffer IndexBuffer) { IBuf = (IndexBuffer)IndexBuffer; GL.VertexArrayElementBuffer(ID, IndexBuffer.ID); }