Beispiel #1
0
        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);
        }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 public void BindIndexBuffer(GfxBuffer IndexBuffer)
 {
     IBuf = (IndexBuffer)IndexBuffer;
     GL.VertexArrayElementBuffer(ID, IndexBuffer.ID);
 }