public void PushFloat(uint count, bool isNormalized) { Elements.Add(new VertexBufferElement() { Type = VertexAttribType.Float, Count = count, IsNormalized = isNormalized }); Stride += count * VertexBufferElement.GetSizeOfType(VertexAttribType.Float); }
public void PushByte(uint count, bool isNormalized) { Elements.Add(new VertexBufferElement() { Type = VertexAttribType.UnsignedByte, Count = count, IsNormalized = isNormalized }); Stride += count * VertexBufferElement.GetSizeOfType(VertexAttribType.UnsignedByte); }
public void AddBuffer(VertexBuffer vb, VertexBufferLayout layout) { Bind(); vb.Bind(); uint offset = 0; for (int i = 0; i < layout.Elements.Count; i++) { VertexBufferElement element = layout.Elements[i]; Gl.VertexAttribPointer((uint)i, (int)element.Count, element.Type, element.IsNormalized, (int)layout.Stride, new IntPtr(offset)); Gl.EnableVertexAttribArray((uint)i); offset += element.Count * VertexBufferElement.GetSizeOfType(element.Type); } }